Package reactor.netty.http.server
Class ConnectionInfo
java.lang.Object
reactor.netty.http.server.ConnectionInfo
Resolve information about the current connection, including the
 host (server) address, the remote (client) address and the scheme.
 
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.
- Since:
- 0.8
- Author:
- Brian Clozel, Andrey Shlykov
- See Also:
- 
Method SummaryModifier and TypeMethodDescriptionstatic intgetDefaultHostPort(String scheme) Returns the default host port number based on scheme.@Nullable StringReturns the X-Forwarded-Prefix if it was part of the request headers.@Nullable InetSocketAddressReturn the host address of the connection.Returns the connection host name.intReturns the connection host port.@Nullable InetSocketAddressReturn the remote address of the connection.Return the connection scheme.withForwardedPrefix(String forwardedPrefix) Return a newConnectionInfowith the forwardedPrefix set.withHostAddress(InetSocketAddress hostAddress) Return a newConnectionInfowith the updated host address.withHostAddress(InetSocketAddress hostAddress, String hostName, int hostPort) Return a newConnectionInfowith updated host address, host name, and host port information.withRemoteAddress(InetSocketAddress remoteAddress) Return a newConnectionInfowith the updated remote address.withScheme(String scheme) Return a newConnectionInfowith the updated scheme.
- 
Method Details- 
getHostAddressReturn the host address of the connection.- Returns:
- the host address
 
- 
getRemoteAddressReturn the remote address of the connection.- Returns:
- the remote address
 
- 
getSchemeReturn the connection scheme.- Returns:
- the connection scheme
 
- 
withHostAddressReturn a newConnectionInfowith the updated host address.- Parameters:
- hostAddress- the host address
- Returns:
- a new ConnectionInfo
 
- 
withHostAddressReturn a newConnectionInfowith updated host address, host name, and host port information.- Parameters:
- hostAddress- the updated host address
- hostName- the updated host name
- hostPort- the updated host port
- Returns:
- a new ConnectionInfo
- Since:
- 1.0.32
 
- 
withRemoteAddressReturn a newConnectionInfowith the updated remote address.- Parameters:
- remoteAddress- the remote address
- Returns:
- a new ConnectionInfo
 
- 
withSchemeReturn a newConnectionInfowith the updated scheme.- Parameters:
- scheme- the connection scheme
- Returns:
- a new ConnectionInfo
 
- 
withForwardedPrefixReturn a newConnectionInfowith the forwardedPrefix set.- Parameters:
- forwardedPrefix- the prefix provided via X-Forwarded-Prefix header
- Returns:
- a new ConnectionInfo
- Since:
- 1.1.23
 
- 
getHostNameReturns the connection host name.- Returns:
- the connection host name
- Since:
- 1.0.32
 
- 
getHostPortpublic int getHostPort()Returns the connection host port.- Returns:
- the connection host port
- Since:
- 1.0.32
 
- 
getForwardedPrefixReturns the X-Forwarded-Prefix if it was part of the request headers.- Returns:
- the X-Forwarded-Prefix
- Since:
- 1.1.23
 
- 
getDefaultHostPortReturns the default host port number based on scheme.- Parameters:
- scheme- a connection scheme like "http", "https", or "wss"
- Returns:
- the default host port number based on scheme
- Since:
- 1.0.32
 
 
-