jsmpeg icon indicating copy to clipboard operation
jsmpeg copied to clipboard

websocket connect with different backend server

Open joyhope opened this issue 3 years ago • 1 comments

`

` The websocket without options. But the websocket request will have Sec-WebSocket-Protocol: null

For some kind of websocket server: python, golang, etc, I guess the null will send back, which caused chrome refused to make WebSocket connection.

Just make small change if (this.options.protocols != null) { this.socket = new WebSocket(this.url, this.options.protocols); } else { this.socket = new WebSocket(this.url); }

So the null information will go away, it is much easy to use.

The relay using websocket-relay.js won't meet the problem, but using other relay will meet the problem in Chrome browser. But won't meet problem in firefox.

joyhope avatar May 28 '22 11:05 joyhope

The similar problem:

https://github.com/defold/extension-websocket/releases/tag/1.5.1

joyhope avatar May 29 '22 00:05 joyhope

+1 on this. I'm trying to run relay from armv7 Raspbian, but can't compile websocket-relay to an executable for armv7 (I've tried nexe, pkg). So I decided to write my own relay backend and the connection fails to be established.

MaxRev-Dev avatar Sep 02 '22 11:09 MaxRev-Dev

Should be fixed with https://github.com/phoboslab/jsmpeg/commit/3afb0e5df2ef0cc21512d956011b83325978686a

phoboslab avatar Sep 04 '22 18:09 phoboslab