nanomsg / nng

nanomsg-next-generation -- light-weight brokerless messaging
https://nng.nanomsg.org
MIT License
3.85k stars 492 forks source link

webasm? #1903

Open Grabber opened 2 weeks ago

Grabber commented 2 weeks ago

Is it possible to use nng as a webasm module for WebSocket?

I have one scenario where I would like to have just one low-level networking library to connect to WebSocket and use it as a base for Android, iOS, WebApp etc.

Is it possible somehow?

gdamore commented 2 weeks ago

Yes, it can be done.. and has been done. Although I'm not too sure about specific details, and it may be tricky if the sandbox doesn't offer regular real networking access. (Arguably we could make a webasm platform port.)

Grabber commented 1 week ago

@gdamore is there anyway to nng implement websockets natively on webasm? Or do we need to somehow use the existing javascript api and interface it backwards to C?

Is there any code to investigate?