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
461 stars 35 forks source link

OkHTTP WebSocket Support #39

Open AhmMhd opened 3 months ago

AhmMhd commented 3 months 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 3 months ago

Hi,

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