()
| 158 | } |
| 159 | |
| 160 | getUrl() { |
| 161 | let protocol = "ws://"; |
| 162 | if(location.protocol.indexOf("https") > -1) { |
| 163 | protocol = "wss://"; |
| 164 | } |
| 165 | return protocol + window.location.host +"/ws"; |
| 166 | } |
| 167 | |
| 168 | socketSend(message:string) { |
| 169 | if(this.socket && this.socket.readyState === 1) { |