Class ProtocolNegotiator

java.lang.Object
dev.relism.flash.transport.ProtocolNegotiator

public final class ProtocolNegotiator extends Object
Detects HTTP/1.1 or HTTP/2 once, before the connection parser is selected.
  • Method Details

    • negotiate

      public static NegotiatedProtocol negotiate(Socket socket, BufferedByteSource source) throws IOException
      Uses the completed TLS ALPN result for secure sockets and a non-consuming prior-knowledge preface probe for plaintext sockets. Configuration gates remain the caller's responsibility, which keeps detection deterministic and independently testable.
      Throws:
      IOException