emscripten-core / emscripten-core/emscripten

posix socket api to websocket does not work with any version of node's ws but works in chrome 92.

Open
#14,750 7 comments 0 reactions 0 assignees View on GitHub
wontfix
Dominant language
C++
Stars
27.6k
Forks
3.6k
Avg merge
1d 1h
Merged PRs (30d)
105

Description

using latest emsdk

I compiled my project with `... -s WEBSOCKET_URL=ws://192.168.1.63:12345 -s WEBSOCKET_DEBUG=1 -s SOCKET_DEBUG=1 -o project.html`

I launched a local ws server on port 12345 to see if any ws connection attempts are made.

I installed node's ws on client side. (I tried every version of ws with npm install ws@1 all the way to ws@7 to rule out that ws version is at fault)

node version is v16.5.0

when I launch the wasm client with
`node project.js`, I get on the node console

> connect: ws://192.168.1.63:12345, binary
> websocket adding peer: 192.168.1.63:12345

but nothing is logged on the ws server console.

When I load project.html in Chrome 92, I immediately see connection attempts on the server console.

I did read somewhere (can't find now where that node's ws version must be 2, so I tried all ws versions in the 2.0.0-2.3.1 range - to no avail)

I really hope I'm missing something simple here. I would appreciate any pointers.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.