SocketCluster / socketcluster-client

JavaScript client for SocketCluster

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Failed to connect to the server in React Native Android

otaradze opened this issue · comments

I am trying to connect to Socket Cluster server in React Native(Android).

The connection fails with the log:

[SocketProtocolError: Socket hung up]

Here is the connect option:

{ hostname: SOCKET_HOST, port: 443, secure: true, rejectUnauthorized: false, }

The same problem, we try to play with options but it didn't help.
Some devices can't connect to channel at all. (return 1005 code) especially Samsung Galaxy S6 (android 7.0)
But what is interesting we can connect simple socket server like a https://www.websocket.org/echo.html

Environment:
"react": "16.8.3",
"react-native": "0.59.9",
"socketcluster-client": "^14.3.1"