Score:0

use HAproxy to route IPv4 address to IPv6

my flag

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]

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.