public class HTTP2CServerConnectionFactory extends HTTP2ServerConnectionFactory implements ConnectionFactory.Upgrading
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 a HTTP1 request of the form "PRI * HTTP/2.0"
is used to trigger a switch to a HTTP2 connection. This approach
allows a single port to accept either HTTP/1 or HTTP/2 direct
connections.
AbstractLifeCycle.AbstractLifeCycleListener
ConnectionFactory.Upgrading
Container.InheritedListener, Container.Listener
LifeCycle.Listener
Constructor and Description |
---|
HTTP2CServerConnectionFactory(HttpConfiguration httpConfiguration) |
Modifier and Type | Method and Description |
---|---|
boolean |
isAcceptable(String protocol,
String tlsProtocol,
String tlsCipher) |
Connection |
upgradeConnection(Connector connector,
EndPoint endPoint,
MetaData.Request request,
HttpFields response101)
Create a connection for an upgrade request.
|
newSessionListener
getHttpConfiguration, getInitialStreamSendWindow, getMaxConcurrentStreams, getMaxDynamicTableSize, newConnection, newFlowControlStrategy, newServerParser, setInitialStreamSendWindow, setMaxConcurrentStreams, setMaxDynamicTableSize
configure, getFactories, getInputBufferSize, getProtocol, getProtocols, setInputBufferSize, toString
addBean, addBean, addBean, addEventListener, addManaged, contains, destroy, doStart, doStop, dump, dump, dump, dump, dump, dumpBeans, dumpObject, dumpStdErr, dumpThis, getBean, getBeans, getBeans, isManaged, manage, removeBean, removeBeans, removeEventListener, setBeans, setStopTimeout, start, stop, unmanage, updateBean, updateBeans
addLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getProtocol, getProtocols, newConnection
public HTTP2CServerConnectionFactory(@Name(value="config") HttpConfiguration httpConfiguration)
public boolean isAcceptable(String protocol, String tlsProtocol, String tlsCipher)
isAcceptable
in interface NegotiatingServerConnection.CipherDiscriminator
isAcceptable
in class HTTP2ServerConnectionFactory
public Connection upgradeConnection(Connector connector, EndPoint endPoint, MetaData.Request request, HttpFields response101) throws BadMessageException
ConnectionFactory.Upgrading
This is a variation of ConnectionFactory.newConnection(Connector, EndPoint)
that can create (and/or customise)
a connection for an upgrade request. Implementations may call ConnectionFactory.newConnection(Connector, EndPoint)
or
may construct the connection instance themselves.
upgradeConnection
in interface ConnectionFactory.Upgrading
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 responseBadMessageException
- Thrown to indicate the upgrade attempt was illegal and that a bad message response should be sent.Copyright © 1995-2015 Webtide. All Rights Reserved.