From: Brian Candler Date: 2008-10-30T04:55:26+09:00 Subject: Re: socket from python to ruby It's not so hard after all: require 'socket' local_host = "127.0.0.1" local_port = 1234 remote_host = "127.0.0.1" remote_port = 80 s = Socket.new(Socket::AF_INET, Socket::SOCK_STREAM, 0) s.bind(Socket.pack_sockaddr_in(local_port, local_host)) s.connect(Socket.pack_sockaddr_in(remote_port, remote_host)) s.write "GET / HTTP/1.0\r\n\r\n" puts s.recv(4096) I found useful examples at http://www.ruby-doc.org/stdlib/libdoc/socket/rdoc/classes/Socket.html#M004233 http://www.ruby-doc.org/stdlib/libdoc/socket/rdoc/classes/Socket.html#M004231 The documentation is much better than when I last looked - although Socket.new doesn't seem to be shown. HTH, Brian. -- Posted via http://www.ruby-forum.com/.