3 - Stable
The net module provides you with an asynchronous network wrapper. It contains
methods for creating both servers and clients (called streams). You can include
this module in your code with require('net');
Example
Here is an example of an echo server which listens for connections on port 8124:
You can test this by using telnet:
telnet localhost 8124
To listen on the socket /tmp/echo.sock the third line from the last would just
be changed to
server.listen('/tmp/echo.sock', function() { //'listening' listener
You can use nc to connect to a UNIX domain socket server:
nc -U /tmp/echo.sock
