ソースを参照

set admin ws url

thomas 3 年 前
コミット
f711cddceb
1 ファイル変更6 行追加1 行削除
  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;
   }