public final class ConnectionInfo extends Object
Depending on the chosen factory method, the information
can be retrieved directly from the channel or additionally
using the "Forwarded"
, or "X-Forwarded-*"
HTTP request headers.
Modifier and Type | Method and Description |
---|---|
InetSocketAddress |
getHostAddress()
Return the host address of the connection.
|
InetSocketAddress |
getRemoteAddress()
Return the remote address of the connection.
|
String |
getScheme()
Return the connection scheme.
|
ConnectionInfo |
withHostAddress(InetSocketAddress hostAddress)
Return a new
ConnectionInfo with the updated host address. |
ConnectionInfo |
withRemoteAddress(InetSocketAddress remoteAddress)
Return a new
ConnectionInfo with the updated remote address. |
ConnectionInfo |
withScheme(String scheme)
Return a new
ConnectionInfo with the updated scheme. |
@Nullable public InetSocketAddress getHostAddress()
@Nullable public InetSocketAddress getRemoteAddress()
public String getScheme()
public ConnectionInfo withHostAddress(InetSocketAddress hostAddress)
ConnectionInfo
with the updated host address.hostAddress
- the host addressConnectionInfo
public ConnectionInfo withRemoteAddress(InetSocketAddress remoteAddress)
ConnectionInfo
with the updated remote address.remoteAddress
- the remote addressConnectionInfo
public ConnectionInfo withScheme(String scheme)
ConnectionInfo
with the updated scheme.scheme
- the connection schemeConnectionInfo