Age | Commit message (Collapse) | Author |
|
Due to a strict interpretation of the spec if "TCP4" is used we
expect two ipv4 addresses (and similar for "TCP6" and ipv6 addresses).
However, the family specified in the proxy header matters only for
the first address (the source), not the destination! After all,
it's not strange to proxy from/to ipv4 and ipv6.
Use getaddrinfo(NI_NUMERICHOST) to parse the IP addresses since
inet_pton() is too strict.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pass to inet_pton the full length of the buffer we're printing to.
It'll take care of NUL-terminating the string. If we subtract one it
may fail to print some IPv6 addresses. Also, no need to NUL-terminate
it again!
|
|
This allows to use proxies like nginx or haproxy in front of gmid and
still have the correct information about the originating client.
This will need explicit opt-in via the `proxy-v1' listen flag which
will be added in a follow-up commit.
Merges https://github.com/omar-polo/gmid/pull/30
|