Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/treaty2/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ const createProxy = (
path +
q

return new EdenWS(url)
return new EdenWS(url, headers['Sec-WebSocket-Protocol'])
}

return (async () => {
Expand Down
4 changes: 2 additions & 2 deletions src/treaty2/ws.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { parseMessageEvent } from '../utils/parsingUtils'
export class EdenWS<in out Schema extends InputSchema<any> = {}> {
ws: WebSocket

constructor(public url: string) {
this.ws = new WebSocket(url)
constructor(public url: string, protocols?: string | string[]) {
this.ws = new WebSocket(url, protocols)
}

send(data: Schema['body'] | Schema['body'][]) {
Expand Down