Skip to content

Instantly share code, notes, and snippets.

@phil-r
Created October 7, 2016 20:02
Show Gist options
  • Save phil-r/c941a0e5d47b5f00137e2f8f6fc8a5cf to your computer and use it in GitHub Desktop.
Save phil-r/c941a0e5d47b5f00137e2f8f6fc8a5cf to your computer and use it in GitHub Desktop.
Simple luvit proxy <3
local http = require('http')
local options = {
host = "www.google.de"
}
http.createServer(function (req, res)
p(req.url)
local destReq = http.request(options, function (destRes)
destRes:pipe(res)
destRes:on('end', function ()
p('end')
end)
end)
destReq:done()
end):listen(1337, '127.0.0.1')
print('Server running at http://127.0.0.1:1337/')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment