Created
November 30, 2019 14:54
-
-
Save roidelapluie/8aff51ae7740f11134832df0c38630ca to your computer and use it in GitHub Desktop.
Simple HTTP Proxy with haproxy (POC - not recommended)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
global | |
log stdout local0 | |
defaults | |
log global | |
log-format "%ci:%cp [%tr] %ft %b/%s %TR/%Tw/%Tc/%Tr/%Ta %ST %B %CC %CS %tsc %ac/%fc/%bc/%sc/%rc %sq/%bq %hr %hs %{+Q}r %si:%sp" | |
frontend proxy | |
bind :3128 | |
mode http | |
http-request do-resolve(txn.myip,mydns,ipv4) hdr(Host),lower unless { url_ip -m found } | |
http-request set-var(txn.myip) url_ip if { url_ip -m found } | |
http-request set-var(txn.myport) url_port | |
use_backend b_503 unless { var(txn.myip) -m found } | |
use_backend forwardproxy | |
resolvers mydns | |
parse-resolv-conf | |
backend b_503 | |
mode http | |
backend forwardproxy | |
mode http | |
option httpclose | |
http-request set-dst var(txn.myip) | |
http-request set-dst-port int(80) | |
http-request set-dst-port var(txn.myport) if { var(txn.myport) -m found } | |
server clear 0.0.0.0:0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment