mirror of
https://github.com/MercuryWorkshop/adrift.git
synced 2025-05-13 14:20:01 -04:00
forward ws protocols
This commit is contained in:
parent
eae44fef4b
commit
ccf556118b
7 changed files with 13 additions and 10 deletions
|
@ -183,6 +183,7 @@ export class Connection {
|
|||
|
||||
wsconnect(
|
||||
url: URL,
|
||||
protocols: string | string[],
|
||||
onopen: () => void,
|
||||
onclose: (code: number, reason: string, wasClean: boolean) => void,
|
||||
onmessage: (data: any) => void,
|
||||
|
@ -191,7 +192,7 @@ export class Connection {
|
|||
send: (data: any) => void;
|
||||
close: (code?: number, reason?: string) => void;
|
||||
} {
|
||||
const payload: C2SWSOpenPayload = { url: url.toString() };
|
||||
const payload: C2SWSOpenPayload = { url: url.toString(), protocols };
|
||||
const payloadJSON = JSON.stringify(payload);
|
||||
let seq = this.nextSeq();
|
||||
// todo: onerror
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue