The program netcat

This program will allow us to connect to a TCP communication channel on the server side as we already do on the client side using the telnet tool.

Since the tool has several features, we will use the switch "-l" to specify that it should work as a TCP server. We then add the switch "-p" followed by the port number on which we want to receive a connection request from a TCP client.

Example to act as a standard http server (port 80) listening on all IP addresses of the machine:

nc -l -p 80

It is also possible to restrict to a single IP address of the machine by specifying the one on which netcat should listen. We then add the switch "-s" followed by the address in the command.

Example to act as a standard http server (port 80) listening only on the address 127.0.0.1:

nc -l -p 80 -s 127.0.0.1