aboutsummaryrefslogtreecommitdiff
path: root/proxy-proto.c
AgeCommit message (Collapse)Author
2024-08-03proxy-protocol: accept cross-family proxyingOmar Polo
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.
2024-08-03remove unused argument from check_port_v1Omar Polo
2024-06-17proxy-proto: ensure there's a space after "TCP4/6"Omar Polo
2024-06-17replace asserts with error returnsOmar Polo
2024-06-17inline PROXY_PROTO_PARSE_* and EXPECT_SUCCESS macrosOmar Polo
2024-06-17invert the arguments in some comparisonsOmar Polo
2024-06-17whitespace and minor style nitsOmar Polo
2024-06-17fix proxy_proto_v1_stringOmar Polo
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!
2024-06-17add support for the proxy protocol v1Christoph Liebender
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