Top Description Fields Constructors Methods
org.eclipse.jetty.http2.server

public Class HTTP2CServerConnectionFactory

extends HTTP2ServerConnectionFactory
implements Upgrading
Class Inheritance
All Implemented Interfaces
org.eclipse.jetty.server.ConnectionFactory.Upgrading, org.eclipse.jetty.server.ConnectionFactory
Imports
org.eclipse.jetty.http.BadMessageException, .HttpFields, .MetaData.Request, org.eclipse.jetty.http2.server.internal.HTTP2ServerConnection, org.eclipse.jetty.io.Connection, .EndPoint, org.eclipse.jetty.server.ConnectionFactory, .Connector, .HttpConfiguration, .HttpConnectionFactory, org.eclipse.jetty.util.annotation.Name, org.slf4j.Logger, .LoggerFactory

HTTP2 Clear Text Connection factory.

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.

Field Summary

Modifier and TypeField and Description
private static final Logger

Constructor Summary

AccessConstructor and Description
public
public
HTTP2CServerConnectionFactory(HttpConfiguration httpConfiguration, String... protocols)

Method Summary

Modifier and TypeMethod and Description
public boolean
public Connection
upgradeConnection(Connector
The connector to upgrade for.
connector
,
EndPoint
The endpoint of the connection.
endPoint
,
MetaData.Request
The meta data of the upgrade request.
request
,
HttpFields.Mutable
The fields to be sent with the 101 response
response101
)

Implements org.eclipse.jetty.server.ConnectionFactory.Upgrading.upgradeConnection.

Create a connection for an upgrade request.

Inherited from org.eclipse.jetty.http2.server.HTTP2ServerConnectionFactory:
newSessionListener

Field Detail

LOGback to summary
private static final Logger LOG

Hides org.eclipse.jetty.http2.server.HTTP2ServerConnectionFactory.LOG.

Constructor Detail

HTTP2CServerConnectionFactoryback to summary
public HTTP2CServerConnectionFactory(HttpConfiguration httpConfiguration)
HTTP2CServerConnectionFactoryback to summary
public HTTP2CServerConnectionFactory(HttpConfiguration httpConfiguration, String... protocols)

Method Detail

isAcceptableback to summary
public boolean isAcceptable(String protocol, String tlsProtocol, String tlsCipher)

Overrides org.eclipse.jetty.http2.server.HTTP2ServerConnectionFactory.isAcceptable.

Implements org.eclipse.jetty.server.NegotiatingServerConnection.CipherDiscriminator.isAcceptable.

Annotations
@Override
upgradeConnectionback to summary
public Connection upgradeConnection(Connector connector, EndPoint endPoint, MetaData.Request request, HttpFields.Mutable response101) throws BadMessageException

Implements org.eclipse.jetty.server.ConnectionFactory.Upgrading.upgradeConnection.

Doc from org.eclipse.jetty.server.ConnectionFactory.Upgrading.upgradeConnection.

Create a connection for an upgrade request.

This is a variation of newConnection(Connector, EndPoint) that can create (and/or customise) a connection for an upgrade request. Implementations may call newConnection(Connector, EndPoint) or may construct the connection instance themselves.

Parameters
connector:Connector

The connector to upgrade for.

endPoint:EndPoint

The endpoint of the connection.

request:MetaData.Request

The meta data of the upgrade request.

response101:HttpFields.Mutable

The fields to be sent with the 101 response

Returns:Connection

Null to indicate that request processing should continue normally without upgrading. A new connection instance to indicate that the upgrade should proceed.

Annotations
@Override
Exceptions
BadMessageException:
Thrown to indicate the upgrade attempt was illegal and that a bad message response should be sent.