forward ws protocols

This commit is contained in:
Spencer Pogorzelski 2023-08-14 21:20:47 -07:00
parent eae44fef4b
commit ccf556118b
7 changed files with 13 additions and 10 deletions

View file

@ -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