HTML and CSS Reference
In-Depth Information
With the module installed, you're ready to continue. Our next listing shows a Node.js app
that will accept a WebSocket request and echo back any message sent to it. Save it as
websocket-sample.js in the same directory as the file from listing 4.11 .
Listing 4.12. A simple Node.js WebSockets server
Try it out
Run listing 4.12 with Node (enter node websocket-sample.js on the command
line). Now open your browser and connect to http://localhost:8080/ and check the console
for the output.
Search WWH ::

Custom Search