Skip to content

NettyHttpContainerProvider not binding to specified hostname #4045

Open
@Chris-Lercher

Description

@Chris-Lercher

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();

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions