()
| 55 | } |
| 56 | |
| 57 | _endpoint() { |
| 58 | // hack to detect if deployment or development environment |
| 59 | const protocol = location.protocol.startsWith('https') ? 'wss' : 'ws'; |
| 60 | const webrtc = window.isRtcSupported ? '/webrtc' : '/fallback'; |
| 61 | const url = protocol + '://' + location.host + location.pathname + 'server' + webrtc; |
| 62 | return url; |
| 63 | } |
| 64 | |
| 65 | _disconnect() { |
| 66 | this.send({ type: 'disconnect' }); |