Class HTTP2CServerConnectionFactory
- All Implemented Interfaces:
ConnectionFactory, ConnectionFactory.Upgrading, NegotiatingServerConnection.CipherDiscriminator, Container, Destroyable, Dumpable, Dumpable.DumpableContainer, LifeCycle
This extension of HTTP2ServerConnection Factory sets the protocol name to "h2c" as used by the clear text upgrade mechanism for HTTP2 and marks all TLS ciphers as unacceptable.
If used in combination with a HttpConnectionFactory as the
default protocol, this factory can support the non-standard direct
update mechanism, where an HTTP1 request of the form "PRI * HTTP/2.0"
is used to trigger a switch to an HTTP2 connection. This approach
allows a single port to accept either HTTP/1 or HTTP/2 direct
connections.
-
Nested Class Summary
Nested classes/interfaces inherited from class HTTP2ServerConnectionFactory
HTTP2ServerConnectionFactory.HTTPServerSessionListenerNested classes/interfaces inherited from class AbstractHTTP2ServerConnectionFactory
AbstractHTTP2ServerConnectionFactory.HTTP2SessionContainerNested classes/interfaces inherited from class AbstractLifeCycle
AbstractLifeCycle.AbstractLifeCycleListener, AbstractLifeCycle.StopExceptionNested classes/interfaces inherited from interface ConnectionFactory
ConnectionFactory.Configuring, ConnectionFactory.Detecting, ConnectionFactory.UpgradingNested classes/interfaces inherited from interface Container
Container.InheritedListener, Container.ListenerNested classes/interfaces inherited from interface Dumpable
Dumpable.DumpableContainerNested classes/interfaces inherited from interface LifeCycle
LifeCycle.Listener -
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionHTTP2CServerConnectionFactory(HttpConfiguration httpConfiguration) HTTP2CServerConnectionFactory(HttpConfiguration httpConfiguration, String... protocols) -
Method Summary
Modifier and TypeMethodDescriptionbooleanisAcceptable(String protocol, String tlsProtocol, String tlsCipher) upgradeConnection(Connector connector, EndPoint endPoint, MetaData.Request request, HttpFields.Mutable response101) Create a connection for an upgrade request.Methods inherited from class HTTP2ServerConnectionFactory
newSessionListenerMethods inherited from class AbstractHTTP2ServerConnectionFactory
getFlowControlStrategyFactory, getHttpConfiguration, getInitialSessionRecvWindow, getInitialStreamRecvWindow, getMaxConcurrentStreams, getMaxDecoderTableCapacity, getMaxEncoderTableCapacity, getMaxFrameSize, getMaxHeaderBlockFragment, getMaxSettingsKeys, getRateControlFactory, getStreamIdleTimeout, isConnectProtocolEnabled, isUseInputDirectByteBuffers, isUseOutputDirectByteBuffers, newConnection, newSettings, setConnectProtocolEnabled, setFlowControlStrategyFactory, setInitialSessionRecvWindow, setInitialStreamRecvWindow, setMaxConcurrentStreams, setMaxDecoderTableCapacity, setMaxEncoderTableCapacity, setMaxFrameSize, setMaxHeaderBlockFragment, setMaxSettingsKeys, setRateControlFactory, setStreamIdleTimeout, setUseInputDirectByteBuffers, setUseOutputDirectByteBuffersMethods inherited from class AbstractConnectionFactory
configure, findNextProtocol, findNextProtocol, getFactories, getInputBufferSize, getProtocol, getProtocols, setInputBufferSize, toStringMethods inherited from class ContainerLifeCycle
addBean, addBean, addEventListener, addManaged, contains, destroy, doStart, doStop, dump, dump, dump, dumpObjects, dumpStdErr, getBean, getBeans, getBeans, getContainedBeans, getContainedBeans, installBean, installBean, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, removeEventListener, setBeans, start, stop, unmanage, updateBean, updateBean, updateBeans, updateBeansMethods inherited from class AbstractLifeCycle
getEventListeners, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, setEventListeners, start, stopMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface ConnectionFactory
getProtocol, getProtocols, newConnectionMethods inherited from interface Container
getCachedBeans, getEventListenersMethods inherited from interface Dumpable.DumpableContainer
isDumpable
-
Constructor Details
-
HTTP2CServerConnectionFactory
public HTTP2CServerConnectionFactory() -
HTTP2CServerConnectionFactory
-
HTTP2CServerConnectionFactory
public HTTP2CServerConnectionFactory(@Name("config") HttpConfiguration httpConfiguration, @Name("protocols") String... protocols)
-
-
Method Details
-
isAcceptable
- Specified by:
isAcceptablein interfaceNegotiatingServerConnection.CipherDiscriminator- Overrides:
isAcceptablein classHTTP2ServerConnectionFactory
-
upgradeConnection
public Connection upgradeConnection(Connector connector, EndPoint endPoint, MetaData.Request request, HttpFields.Mutable response101) throws BadMessageException Description copied from interface:ConnectionFactory.UpgradingCreate a connection for an upgrade request.This is a variation of
ConnectionFactory.newConnection(Connector, EndPoint)that can create (and/or customise) a connection for an upgrade request. Implementations may callConnectionFactory.newConnection(Connector, EndPoint)or may construct the connection instance themselves.- Specified by:
upgradeConnectionin interfaceConnectionFactory.Upgrading- Parameters:
connector- The connector to upgrade for.endPoint- The endpoint of the connection.request- The meta data of the upgrade request.response101- The fields to be sent with the 101 response- Returns:
- Null to indicate that request processing should continue normally without upgrading. A new connection instance to indicate that the upgrade should proceed.
- Throws:
BadMessageException- Thrown to indicate the upgrade attempt was illegal and that a bad message response should be sent.
-