crossle / janus-gateway-android

Implements Janus gateway video room on Android
MIT License
63 stars 30 forks source link

unexpected end of stream #17

Closed sajidjutt7 closed 4 years ago

sajidjutt7 commented 4 years ago

Yesterday it showed connection success response. I tried multiple times. Now i try to run it again my janus server is running

But app is giving this error

E/WebSocketChannel: onFailurejava.io.IOException: unexpected end of stream on okhttp3.Address@1e366953

I also try some solutions but nothing works Tried this: OkHttpClient client = new OkHttpClient.Builder() .retryOnConnectionFailure(true) .build();

Also tried this addHeader("Connection","close")

Nothing worked.

sajidjutt7 commented 4 years ago

My mistake. I accidently add a letter in this string "Sec-WebSocket-Protocol" as "Sec-wWebSocket-Protocol". Correcting it resolves the error. But you should mention it through logs so we can figure out where is mistake. builder.addHeader("Sec-WebSocket-Protocol", "janus-protocol");