There is a nice trick to instantly serve contents of a current working directory by HTTP locally:

$ python -m SimpleHTTPServer

This command launches HTTP server at *:8000, serving $PWD contents.

I'm looking for something similar, but for setting up a reverse-proxy.

Something like this:

$ instant-reverse-http-proxy --listen-on 'http://localhost:8000/' --proxy-to 'https://example.com/path'`

So that

$ GET http://localhost:8000/bar

would fetch https://example.com/path/bar.

Any clues?

link|improve this question

feedback

1 Answer

socat?

# socat TCP-LISTEN:80,reuseaddr,fork,su=nobody TCP:www.dmz.mydomain.org:80

(from http://lorgor.blogspot.com/2009/11/socat.html and
http://stuff.mit.edu/afs/sipb/machine/penguin-lust/src/socat-1.7.1.2/EXAMPLES)

# socat -vv OPENSSL-LISTEN:443,cert=cert.pem,cafile=cacert.pem,cert=cert.key, \
reuseaddr,fork TCP4:192.168.34.65:80

(from http://www.buntschu.ch/blog/?p=242)

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.