Class HTTP2CServerConnectionFactory

  • All Implemented Interfaces:
    org.eclipse.jetty.server.ConnectionFactory, org.eclipse.jetty.server.ConnectionFactory.Upgrading, org.eclipse.jetty.server.NegotiatingServerConnection.CipherDiscriminator, org.eclipse.jetty.util.component.Container, org.eclipse.jetty.util.component.Destroyable, org.eclipse.jetty.util.component.Dumpable, org.eclipse.jetty.util.component.Dumpable.DumpableContainer, org.eclipse.jetty.util.component.LifeCycle

    public class HTTP2CServerConnectionFactory
    extends HTTP2ServerConnectionFactory
    implements org.eclipse.jetty.server.ConnectionFactory.Upgrading
    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 Detail

      • LOG

        private static final org.eclipse.jetty.util.log.Logger LOG
    • Constructor Detail

      • HTTP2CServerConnectionFactory

        public HTTP2CServerConnectionFactory​(@Name("config")
                                             org.eclipse.jetty.server.HttpConfiguration httpConfiguration)
      • HTTP2CServerConnectionFactory

        public HTTP2CServerConnectionFactory​(@Name("config")
                                             org.eclipse.jetty.server.HttpConfiguration httpConfiguration,
                                             @Name("protocols")
                                             java.lang.String... protocols)
    • Method Detail

      • isAcceptable

        public boolean isAcceptable​(java.lang.String protocol,
                                    java.lang.String tlsProtocol,
                                    java.lang.String tlsCipher)
        Specified by:
        isAcceptable in interface org.eclipse.jetty.server.NegotiatingServerConnection.CipherDiscriminator
        Overrides:
        isAcceptable in class HTTP2ServerConnectionFactory
      • upgradeConnection

        public org.eclipse.jetty.io.Connection upgradeConnection​(org.eclipse.jetty.server.Connector connector,
                                                                 org.eclipse.jetty.io.EndPoint endPoint,
                                                                 org.eclipse.jetty.http.MetaData.Request request,
                                                                 org.eclipse.jetty.http.HttpFields response101)
                                                          throws org.eclipse.jetty.http.BadMessageException
        Specified by:
        upgradeConnection in interface org.eclipse.jetty.server.ConnectionFactory.Upgrading
        Throws:
        org.eclipse.jetty.http.BadMessageException