Example demonstrating how websockify and nbind could be used to port a network application using tcp sockets into the web
###Running Commands are assumed to be run from repo root
-
initialize submodules:
git submodule update --init
-
build websockify:
cd websockify && make
-
build server with CMake (you need boost)
You may use any program which does some network interaction, I use echo server as an example
-
build client (optional, since the repo contains prebuilt js code)
you need emsdk to do this
cd client && npm install && make
-
run server:
cd websockify && run 8080 -- ./path-to-server-executable 8080
-
run client: *
cd client && python3 -m http.server
* navigate to http://localhost:8000/index.html in a browser * open debug console * you should see outputsending message: foobar
got message: foobar
message size: 6