Covers setups when kamailio behind the service with HAPROXY protocol support but in other hand it also serves requests from other services that available per direct connection (such as B2BUA in the same local network).
#### Pre-Submission Checklist - [*] Commit message has the format required by CONTRIBUTING guide - [*] Commits are split per component (core, individual modules, libs, utils, ...) - [*] Each component has a single commit (if not, squash them into one commit) - [*] No commits to README files for modules (changes must be done to docbook files in `doc/` subfolder, the README file is autogenerated)
#### Type Of Change - [ ] Small bug fix (non-breaking change which fixes an issue) - [*] New feature (non-breaking change which adds new functionality) - [ ] Breaking change (fix or feature that would change existing functionality)
#### Checklist: - [*] PR should be backported to stable branches - [*] Tested changes locally
#### Description - function tcpconn_read_haproxy() returns 2 if PROXY header NOT found. - Message about no header shown at the debug level. - No errors - TCP connection successfully establishes
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/2206
-- Commit Summary --
* handle tcp request with tcp_accept_haproxy even no PROXY header found * core:tcp allow to handle TCP connections even message does not contain PROXY protocol header * core:tcp allow to handle TCP connections even message does not contain PROXY protocol header
-- File Changes --
M src/core/tcp_main.c (8)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/2206.patch https://github.com/kamailio/kamailio/pull/2206.diff
@ovoshlook pushed 1 commit.
55fa4da56f03839726762b5668c945ebd35ca9c5 core:tcp shwitched back to LM_ERR level for invalid PROXY header message
I applied the patches manually, with some updates to log messages. Test and if any issues, report on bug tracker. Thanks!
Closed #2206.
tested - works fine. IS it possible to push it into 5.3.x branch as well? I know there more changes in the tcp_main a 5.4.0 I can prepare PR for 5.3 branch.
Documentation still states in the core cookbook:
Please note that enabling this option will reject any inbound TCP connection that does not conform to the PROXY-protocol spec.
So I started looking at making this a per-listen socket option.. And then ran into this commit. Apparently all connections would be accepted now in 5.6, including my Prometheus scraping through xhttp? So the only side effect of having non-proxyprotocol connections is a debug-level message about it?
Hi I think, I just forgot to update this part of the doc. It should be working fine for any connection type and yes. It should be only a debug-level message
But feel free to test it and let us know if something is wrong.