Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

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)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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