Total Pageviews

Thursday, 23 June 2016

HTTP Connect Proxy

A simple HTTP CONNECT (and only CONNECT) proxy, written in Go Lang.

It runs in the foreground.


6g -o httpconnectproxy.6 httpconnectproxy.go
6l -o httpconnectproxy httpconnectproxy.6


It will listen by default on

Usage of ./httpconnectproxy:
  -E="": Executable to run with CONNECT string as argument
  -P="": :port or ip:port to listen on.

For example, to listen on all interfaces on port 8080 and forward
using TCP, run:

$ ./httpconnectproxy -P :8080

To listen on port 8080 and echo the destination back to the caller
by calling /bin/echo, run:

$ ./httpconnectproxy -P :8080 -E /bin/echo

The executable is not passed through a shell, and it will be called with
exactly one argument, the string that's between "CONNECT " and " HTTP/1"

The REMOTE environment variable will be set, allowing you to do some some basic
security or logging.