Kaynağa Gözat

set admin ws url

thomas 3 yıl önce
ebeveyn
işleme
f711cddceb
1 değiştirilmiş dosya ile 6 ekleme ve 1 silme
  1. 6 1
      src/components/AdminCommands.vue

+ 6 - 1
src/components/AdminCommands.vue

@@ -27,15 +27,20 @@ export default class AdminCommands extends Vue {
   
   socket = null
   responses = []
+  url = 'http://localhost:3111'
 
   connect(){
-    const socket = io.connect()
+    const socket = io.connect(this.url)
     let cnt = 0;
     socket.on('admin_response', (data) => {
       cnt++;
       this.responses.unshift({cnt, data: JSON.stringify(data,null,3)})
     })
 
+    socket.on('connect', (ws) => {
+      console.info('admin connected', ws, socket?.id)
+    });
+
     socket.connect();
     this.socket = socket;
   }