A simple working example (for all modern browsers) and - yes, I'm looking at YOU, you… WebSocket blog article writers - without socket.io (for now at least), Express, JQuery and other black-box baggage…
Clone/download then from the command-line change directory to node-websocket-test
, and install dependencies with npm install
. Run by typing node server.js
and visiting localhost:8080
in a browser.
After much hacking and failing, Phil fixed this so it actually works (thanks!). Here's the original WebSocket question on Stack Overflow which - as is sadly often the case these days - has had no answers. So I'll probably go and answer it myself at some point.