google / cronet-transport-for-okhttp

This package allows OkHttp and Retrofit users to use Cronet as their transport layer, benefiting from features like QUIC/HTTP3 support or connection migration.
Apache License 2.0
450 stars 34 forks source link

OkHTTP WebSocket Support #39

Open AhmMhd opened 1 month ago

AhmMhd commented 1 month ago

I am trying to open a websocket connection using okhttp + cronet. It's failing every time with following exception:

java.io.IOException: java.util.concurrent.ExecutionException: m.mc: Exception in CronetUrlRequest: net::ERR_INVALID_HTTP_RESPONSE, ErrorCode=11, InternalErrorCode=-370, Retryable=false

my okhttp clinet: val webSocket = OkHttpClient.Builder() .addInterceptor(CronetInterceptor.newBuilder(cronetEngine).build())

My connection works if i remove CronetInterceptor. Can anyone confirm is cronet supports websocket connections?

edechamps-Google commented 1 month ago

Hi,

I'm afraid Cronet does not support WebSocket. Therefore the OkHttp Cronet transport doesn't support it either.