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 | 
|---|---|
static int | 
getDefaultHostPort(String scheme)
Returns the default host port number based on scheme. 
 | 
@Nullable String | 
getForwardedPrefix()
Returns the X-Forwarded-Prefix if it was part of the request headers. 
 | 
@Nullable InetSocketAddress | 
getHostAddress()
Return the host address of the connection. 
 | 
String | 
getHostName()
Returns the connection host name. 
 | 
int | 
getHostPort()
Returns the connection host port. 
 | 
@Nullable InetSocketAddress | 
getRemoteAddress()
Return the remote address of the connection. 
 | 
String | 
getScheme()
Return the connection scheme. 
 | 
ConnectionInfo | 
withForwardedPrefix(String forwardedPrefix)
Return a new  
ConnectionInfo with the forwardedPrefix set. | 
ConnectionInfo | 
withHostAddress(InetSocketAddress hostAddress)
Return a new  
ConnectionInfo with the updated host address. | 
ConnectionInfo | 
withHostAddress(InetSocketAddress hostAddress,
               String hostName,
               int hostPort)
Return a new  
ConnectionInfo with updated host address, host name, and host port information. | 
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. | 
public @Nullable InetSocketAddress getHostAddress()
public @Nullable InetSocketAddress getRemoteAddress()
public String getScheme()
public ConnectionInfo withHostAddress(InetSocketAddress hostAddress)
ConnectionInfo with the updated host address.hostAddress - the host addressConnectionInfopublic ConnectionInfo withHostAddress(InetSocketAddress hostAddress, String hostName, int hostPort)
ConnectionInfo with updated host address, host name, and host port information.hostAddress - the updated host addresshostName - the updated host namehostPort - the updated host portConnectionInfopublic ConnectionInfo withRemoteAddress(InetSocketAddress remoteAddress)
ConnectionInfo with the updated remote address.remoteAddress - the remote addressConnectionInfopublic ConnectionInfo withScheme(String scheme)
ConnectionInfo with the updated scheme.scheme - the connection schemeConnectionInfopublic ConnectionInfo withForwardedPrefix(String forwardedPrefix)
ConnectionInfo with the forwardedPrefix set.forwardedPrefix - the prefix provided via X-Forwarded-Prefix headerConnectionInfopublic String getHostName()
public int getHostPort()
public @Nullable String getForwardedPrefix()
public static int getDefaultHostPort(String scheme)
scheme - a connection scheme like "http", "https", or "wss"