eclipse-ee4j / eclipse-ee4j/jersey
NettyHttpContainerProvider not binding to specified hostname
- Dominant language
- Java
- Stars
- 730
- Forks
- 382
- PR merge metrics
- No merged PRs in 30d
Description
With `org.glassfish.jersey.netty.httpserver.NettyHttpContainerProvider` (jersey-container-netty-http version 2.28), it is impossible to bind to a specific network address/hostname. Both the `createServer` and `createHttp2Server` methods use `b.bind(port)` instead of `b.bind(inetHost, port)`.
A workaround is not so easy to do, as the NettyHttpContainer class is package-private (so my ugly workaround is to create a new class in the org.glassfish.jersey.netty.httpserver package, and copy the code of NettyHttpContainerProvider).
Please compare the implementation to e.g. org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpServerFactory#createHttpServer , which uses
`final String host = (uri.getHost() == null) ? NetworkListener.DEFAULT_NETWORK_HOST : uri.getHost();`
Contributor guide
Assessment
This issue has not been assessed yet.