java - Extending OkHttp protocol selection -
i trying implement client http/2-based protocol using okhttp. protocol unencrypted http/2-prior-knowledge stream on custom tcp protocol (yes, know it's broken, no, can't change it).
okhttp3 seems support http/2 prior knowledge when using tcp, built custom sslsocketfactory
, sslsocket
implement protocol. hacky works alright until prior knowledge requirement kicks in. remote not support http/1.1->http/2 upgrade, requires prior knowledge, okhttp seems support via tls extensions, protocol selection code is platform-dependent.
is there way hook protocol selection logic not involve reimplementing half of okhttp or reflecting okhttp- or jdk-internal classes? maybe without fake-tls hack? replacing realconnection
not feasible, since okhttp not provide sort of connectionfactory
can implement.
okhttp http/2 on https alpn. since you’re stuck own custom protocol, consider adding http/2 on https server sits in front of custom protocol. might able nginx?
Comments
Post a Comment