Skip to content

--haproxy-clientip sets destination IP, not client IP #11619

@bagder

Description

@bagder

Discussed in #11613

Originally posted by marsom August 7, 2023
Hi,

ok I'm probably wrong, I expected the from following curl:

curl --ipv4 --haproxy-clientip 192.168.1.2 http://localhost:8080

to set the client ip in the proxy protocol header to 192.168.1.2. in the proxy protocol naming for me its the source ip not the destination.

but

result = Curl_dyn_addf(&ctx->data_out, "PROXY %s %s %s %i %i\r\n",

sets the destination address.

when i read ie.

i think the client ip = source ip

if I dump the payload from the command obove i get

PROXY TCP4 127.0.0.1 192.168.1.2 62190 8080
GET / HTTP/1.1
Host: localhost:8080
User-Agent: curl/8.2.1
Accept: */*
...

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions