From: ts Date: 2002-04-07T21:41:15+09:00 Subject: Re: a mud-client in ruby? >>>>> "T" == Tyler Spivey writes: T> #!/usr/bin/perl -w Well, I don't know this strange language but you can write something like this pigeon% cat b.rb #!/usr/bin/ruby require 'socket' raise "usage #$0 host port" if ARGV.size != 2 handle = TCPSocket.new *ARGV handle.sync = true Thread.new do handle.each do |line| puts ">> #{line}" end exit end while s = $stdin.gets handle.puts s end pigeon% pigeon% b.rb www.ruby-lang.org 80 HEAD / HTTP/1.1 Host: www.ruby-lang.org Connection: Keep-Alive >> HTTP/1.1 301 Moved Permanently >> Date: Sun, 07 Apr 2002 12:39:08 GMT >> Server: Apache/1.3.9 (Unix) Debian/GNU mod_ruby/0.9.4 Ruby/1.6.6 >> Location: http://www.ruby-lang.org/en/index.html >> Keep-Alive: timeout=15, max=100 >> Connection: Keep-Alive >> Content-Type: text/html; charset=iso-8859-1 >> HEAD / HTTP/1.1 Host: www.ruby-lang.org Connection: Close >> HTTP/1.1 301 Moved Permanently >> Date: Sun, 07 Apr 2002 12:39:17 GMT >> Server: Apache/1.3.9 (Unix) Debian/GNU mod_ruby/0.9.4 Ruby/1.6.6 >> Location: http://www.ruby-lang.org/en/index.html >> Connection: close >> Content-Type: text/html; charset=iso-8859-1 >> pigeon% Guy Decoux