Last active
May 21, 2016 22:24
-
-
Save cablehead/d61474fa7a3f8b2ea00057c730b726ec to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local levee = require("levee") | |
local p = levee.p | |
local h = levee.Hub() | |
local err, serve = h.stream:listen(9000) | |
for conn in serve do | |
h:spawn(function() | |
local stream = conn:stream() | |
while true do | |
local err, line = p.line.stream(stream, "\r\n") | |
if err then break end | |
conn:send(line.."\r\n") | |
end | |
conn:close() | |
end) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment