Browse Source

set admin ws url

thomas 3 years ago
parent
commit
f711cddceb
1 changed files with 6 additions and 1 deletions
  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;
   }