Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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

Theres a node module for that: https://github.com/cha0s/kiss-proxy. Supports command line arguments and a config file for more complex situations.

Only downside with kiss-proxy is that it looks slightly dated and may not run on newer versions of node.

share|improve this answer
    
could you give more detail than a link ? – Archemar Nov 18 '15 at 9:06

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.