I wish to direct all http traffic on port 4000 on an IPv4 server, to another server that only accepts IPv6. socat
works for fine for http (but not https) as follows:
sudo socat TCP4-LISTEN:4000,fork TCP6:[xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx]:4000
However I'd prefer to use HAproxy because that will allow me to do a bunch of other stuff like load balancing and multiple sites to one IP. This /etc/haproxy/haproxy.cfg
however does NOT work ("site cannot be reached") for http.
defaults
log global
mode http
option dontlognull
timeout connect 5000
timeout client 50000
timeout server 50000
frontend myfrontend
bind 127.0.0.1:4000
default_backend vernon
backend vernon
server rpi [xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx]:4000
What am I doing wrong here? I'd like HAproxy to do exactly what socat does in the above example.
Separately, what other changes would be necessary to get https working too.
[please note this answer looks relevant but is not because it's for UDP: https://serverfault.com/questions/1107205/haproxy-as-a-ipv4-to-ipv6]