From: Derek Smith Date: 2010-04-03T05:07:00+09:00 Subject: Re: socket programming...lsof? > env ruby -w > require 'socket' > host = 'localhost' > port = 22 > # > s = TCPSocket.open(host, port) > > while line = s.gets # Read lines from the socket > puts line.chop # And print with platform line terminator > end > s.close # Close the socket when done > > > derek@vaio-ubuntu:~$ sudo ruby port_tst.rb > SSH-2.0-OpenSSH_5.1p1 Debian-5ubuntu1 What if I want to see any data passing over that port, 113 or any other port? Any adjustments in this code? SSH port 22 seems to work, well sort of. When connections come in, shouldn't I see some type of encryption strings? -- Posted via http://www.ruby-forum.com/.