- if (!!this.st.conn && this.st.conn.readyState == 1) //1 == OPEN state
- funcPollClients();
- else //socket not ready yet (initial loading)
- this.st.conn.onopen = funcPollClients;
- 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.onopen = funcPollClients;
+ this.conn.onmessage = this.socketMessageListener;