- // Define socket .onmessage() and .onclose() events:
- this.st.conn.onmessage = this.socketMessageListener;
+ // Initialize connection
+ this.page = this.$route.path;
+ const connexionString = params.socketUrl +
+ "/?sid=" + this.st.user.sid +
+ "&tmpId=" + this.tempId +
+ "&page=" + encodeURIComponent(this.page);
+ this.conn = new WebSocket(connexionString);
+ this.conn.onmessage = this.socketMessageListener;