Skip to content

Instantly share code, notes, and snippets.

Created August 13, 2010 15:30
Show Gist options
  • Save anonymous/523055 to your computer and use it in GitHub Desktop.
Save anonymous/523055 to your computer and use it in GitHub Desktop.
#!/usr/bin/ruby -w
require 'socket'
server = TCPServer.open(7788)
loop do
Thread.start(server.accept) do |client|
remote = TCPSocket.open("bbs.csie.ntnu.edu.tw", 23)
Thread.start do
while s = remote.getc do
client.write s.chr
end
end
Thread.start do
while s = client.getc do
remote.write s.chr
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment