Skip to content

Instantly share code, notes, and snippets.

View o-jasper's full-sized avatar
💭
Just maybe i'll respond.

Jasper den Ouden (leave Github) o-jasper

💭
Just maybe i'll respond.
View GitHub Profile
@diogok
diogok / proxy.lua
Created April 15, 2011 17:09
Simple HTTP reverse proxy in Lua
#!/usr/bin/env lua
require 'socket'
require 'copas'
assert(arg[1],"Must pass host and port to listen")
assert(arg[2],"Must pass host and port to proxy")
local config = {
newhost=string.gsub(arg[1],"([^:]+):(%d+)","%1"),
newport=string.gsub(arg[1],"([^:]+):(%d+)","%2"),