Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HAProxyProtocol support in webserver #7458

Closed
ggsrivas opened this issue Aug 25, 2023 · 7 comments
Closed

HAProxyProtocol support in webserver #7458

ggsrivas opened this issue Aug 25, 2023 · 7 comments
Assignees
Labels
3.x Issues for 3.x version branch enhancement New feature or request P3 SE webserver

Comments

@ggsrivas
Copy link

Environment Details

  • Helidon Version: 3.x
  • Helidon SE or Helidon MP: Helidon SE
  • JDK version: 17
  • OS: OS agnostic
  • Docker version (if applicable):

Problem Description

My Webserver is built using Helidon. I want to enable HAProxy proxy-protocol on my Load balancer that will require this webserver to parse the response correctly. but, I don't see support for proxy-protocol in Helidon.
It would have been helpful if Helidon had support for custom childHandlers for NettyWebServer so, that I could have added this handler myself. See below screenshot,

Screen Shot 2023-08-25 at 8 53 59 AM

This is a feature enhancement request, not a bug. It would be great if this support is added directly in the framework and it can be enabled as a configuration. Support for custom childHandler will also resolve this gap. Please note that this support already exists in Netty but since, there is no way to enable it with Helidon.

references:
Proxy-protocol: https://www.haproxy.com/blog/use-the-proxy-protocol-to-preserve-a-clients-ip-address
Netty proxy protocol: https://netty.io/4.0/api/io/netty/handler/codec/haproxy/HAProxyProxiedProtocol.html

@romain-grecourt romain-grecourt added SE webserver 3.x Issues for 3.x version branch enhancement New feature or request labels Aug 25, 2023
@spericas
Copy link
Member

@ggsrivas Is the use of HTTP headers to convey client info not a viable alternative in your case?

@ggsrivas
Copy link
Author

Hi @spericas , With the Layer4 load balancer, The client info is not preserved. These Load balancers will put their own IP in the header. The proxy protocol is used to preserve that information.

@m0mus m0mus added the P3 label Aug 31, 2023
@spericas spericas self-assigned this Aug 31, 2023
@spericas
Copy link
Member

spericas commented Sep 8, 2023

@ggsrivas I put together a prototype based on what you shared with me. For now, it only adds X-Forwarded-For with some client info as an example (it also adds a config flag to enable the protocol). There's a single V1 test.

https://github.com/spericas/helidon/pull/3/files

Please take a look and let me know what you think.

@ggsrivas
Copy link
Author

ggsrivas commented Sep 8, 2023

The changes look good. Thanks.

@spericas
Copy link
Member

@ggsrivas Could you comment on which other headers are you expecting? Also on how do you expect OCI's LB data to be available? Thanks.

@ggsrivas
Copy link
Author

Just the IP address is good enough for my use case. I am thinking the details should be similar to how they are described in this doc,

https://github.com/haproxy/haproxy/blob/master/doc/proxy-protocol.txt

@spericas
Copy link
Member

Since we are nearly done supporting this in 4.x (#7829) and there is no longer an immediate requirement to support this in 3.x, I am closing this issue. We can reopen it at later time and use the prototype linked above as a starting point.

@m0mus m0mus added this to Backlog Aug 12, 2024
@m0mus m0mus moved this to Closed in Backlog Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.x Issues for 3.x version branch enhancement New feature or request P3 SE webserver
Projects
Archived in project
Development

No branches or pull requests

4 participants