In general it is not possible to "listen" in the way you describe using any web platform API. We only have the WebSockets.
All the current ways of doing networking in emscripten are documented at https://emscripten.org/docs/porting/networking.html IIUC the only method that has any kind of "listen" ability is "Full POSIX Sockets over WebSocket Proxy Server" which does require a server and there are no alternatives that I'm aware of. cheers, sam On Fri, Jul 1, 2022 at 11:21 AM Taimoor Mirza <[email protected]> wrote: > Hi, > > I have a C++ based application that acts a server and listens for > connection on a port passed to it in args. You can say its more like a GDB > Server that eventually will run in my browser and listen on a port and my > remote GDB client (on another machine) can then connect to it. I am > planning to build this application with em++ and use it from my javascript > code. > I was able to build my app after various issues but it did not work. > Looking at emscripten testsuite, I found some basic socket servers but it > seems they rely on running something like WebSockify on the server side to > enable the TCP server stack to receive incoming WebSocket connections. But > this requires running an external application...Can't I do all this from > within my javascript code that will be running in my browser. My plan was: > > I'll build wasm for my server application, My JS code will run this wasm > and will also run websockify and then it will listen for connections as it > does when I run it natively on my host. > > Thanks, > Taimoor > > -- > You received this message because you are subscribed to the Google Groups > "emscripten-discuss" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/emscripten-discuss/4c3fba21-29f7-4f18-9e78-2595ce1fce83n%40googlegroups.com > <https://groups.google.com/d/msgid/emscripten-discuss/4c3fba21-29f7-4f18-9e78-2595ce1fce83n%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "emscripten-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/emscripten-discuss/CAL_va289tebOt_ZPePBqBF-vx1Zq2v96b8WDqgv7VkSJE%3DET%3Dg%40mail.gmail.com.
