diff --git a/view/lib/ws-client-es6.js b/view/lib/ws-client-es6.js index df4443f..ff2f8e0 100644 --- a/view/lib/ws-client-es6.js +++ b/view/lib/ws-client-es6.js @@ -14,6 +14,7 @@ class WSClient{ /* (1) Store the arguments */ this.server_url = server_url; this.channel_uri = channel_uri; + this.built_url = this.server_url+'/'+this.channel_uri; /* (2) Initialise event data */ this.is_opened = false; // Set to TRUE when connection opened @@ -21,7 +22,7 @@ class WSClient{ this.handler = []; // On reveice handlers /* (3) Create the websocket connection */ - this.ws = new WebSocket(this.server_url+'/'+channel_uri); + this.ws = new WebSocket(this.built_url); /* (2) Bind events @@ -133,7 +134,7 @@ class WSClient{ } /* (3) If not for this channel -> exit */ - if( msg_event.target.url != this.server_url+'/'+this.channel_uri ) + if( msg_event.target.url != this.built_url ) return; /* (3) Try to JSON parse */