[cs631apue] Testing the server
Jan Schaumann
jschauma at stevens.edu
Sat Nov 2 15:18:26 EDT 2013
Paul-Anthony Dudzinski <pdudzins at stevens.edu> wrote:
> Is anyone else having a hard time using telnet to connect between different
> scrit labs (smurf and nemo)?
That should work. You can test this by using the nc(1) command. For
example:
smurf$ nc -l 12345
nemo$ telnet smurf 12345
Connected to smurf.srcit.stevens-tech.edu.
Escape character is '^]'.
hello
Remember that telnet uses TCP, so if you're testing with a UDP server,
then telnet won't work. nc(1) can be used to connect to a UDP server,
though:
smurf$ nc -u -l 12345
nemo$ echo hello | nc -u smurf 12345
> I am trying to use to test my web server. I can get a connection on
> port 22 though...
That's the ssh daemon listening.
Also remember that you cannot open a port <1024 unless you're the
super-user.
Finally, you can see what ports are open on a system using netstat(1),
for example.
-Jan
More information about the cs631apue
mailing list