React native + SSL套接字:错误:xhr轮询错误

我正在使用socket.io-client从反应原生应用程序与ssl套接字服务器连接套接字,并在connect-error事件获取connect-error[Error: xhr poll error]

这是我的代码从反应原生(客户端):

 import io from 'socket.io-client'; import Config from '../../config'; var socketConfig = { secure: true } function connect() { this.socket = io(Config.notificationUrl, socketConfig); // this.socket.connect(); this.socket.on('connect', () => console.log("Socket connected", self.socket.id)); this.socket.on('connect_error', (err) => console.log("connect_error", err)); this.socket.on('error', (err) => console.log("error", err)); } 

我试图添加传输:['websocket','轮询]到socketConfig,但我也得到了其他错误[Error: websocket error] 。 还尝试import io from 'socket.io-client/dist/socket.io'使用import io from 'socket.io-client/dist/socket.io' ,但没有什么不同。

注意:我成功连接到使用http协议的套接字服务器。

我正在使用原生0.40.0和socket.io-client 1.7.3。