Skip to content

Instantly share code, notes, and snippets.

@zeen
Created December 16, 2010 20:31
Show Gist options
  • Save zeen/743962 to your computer and use it in GitHub Desktop.
Save zeen/743962 to your computer and use it in GitHub Desktop.
require "socket"
client = socket:tcp();
client:connect("localhost", 5582);
while true do
local ch = client:receive(1);
if string.char(0) == ch then
local line = io.read("*l");
client:send(line.."\n");
else
io.write(ch);
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment