Spaces:
Running
on
L40S
Running
on
L40S
wongfei2009
commited on
Commit
β’
38348ec
1
Parent(s):
8aafe2e
Update facePoke.ts
Browse filesFix of https://github.com/jbilcke-hf/FacePoke/issues/6
client/src/lib/facePoke.ts
CHANGED
@@ -50,7 +50,9 @@ export class FacePoke {
|
|
50 |
console.log(`[FacePoke] Initializing WebSocket connection`);
|
51 |
|
52 |
const connect = () => {
|
53 |
-
|
|
|
|
|
54 |
|
55 |
this.ws.onopen = this.handleWebSocketOpen.bind(this);
|
56 |
this.ws.onclose = this.handleWebSocketClose.bind(this);
|
|
|
50 |
console.log(`[FacePoke] Initializing WebSocket connection`);
|
51 |
|
52 |
const connect = () => {
|
53 |
+
const protocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:';
|
54 |
+
this.ws = new WebSocket(`${protocol}//${window.location.host}/ws`);
|
55 |
+
|
56 |
|
57 |
this.ws.onopen = this.handleWebSocketOpen.bind(this);
|
58 |
this.ws.onclose = this.handleWebSocketClose.bind(this);
|