Package dev.relism.flash.transport
Class ProtocolNegotiator
java.lang.Object
dev.relism.flash.transport.ProtocolNegotiator
Detects HTTP/1.1 or HTTP/2 once, before the connection parser is selected.
-
Method Summary
Modifier and TypeMethodDescriptionstatic NegotiatedProtocolnegotiate(Socket socket, BufferedByteSource source) Uses the completed TLS ALPN result for secure sockets and a non-consuming prior-knowledge preface probe for plaintext sockets.
-
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
-