【问题标题】:Can't connect to web socket react-native-meteor iOS无法连接到 Web 套接字 react-native-meteor iOS
【发布时间】:2017-07-13 08:55:40
【问题描述】:

我正在使用 react-native-meteor,并且无法仅通过 iOS 连接到 Web 套接字。我的应用程序在 android 模拟器上运行时运行良好,但在 iOS 模拟器或设备中无法运行。这是我的代码:

Meteor.connect('ws://app.mysite.com/websocket');

还有日志:

[info][tid:main][RCTBatchedBridge.m:72] Initializing <RCTBatchedBridge: 0x7fe23b23d4c0> (parent: <RCTBridge: 0x7fe239d65090>, executor: RCTJSCExecutor)
[warn][tid:main][RCTEventEmitter.m:54] Sending `websocketFailed` with no listeners registered.


Disconnected from DDP server.

知道为什么我不能只在 iOS 上连接吗?

我已经禁用了 App Transport Security,并下载了一个非 https 网页,所以我知道这不是问题

【问题讨论】:

    标签: ios react-native react-native-meteor


    【解决方案1】:

    嗯,我想通了。我认为我错误地配置了应用程序传输安全异常。为了修复它,我像这样连接到安全网络套接字(注意额外的 s):

    Meteor.connect('wss://app.mysite.com/websocket');
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-04-19
      • 1970-01-01
      • 2021-08-10
      • 2021-08-23
      • 1970-01-01
      • 2022-07-07
      相关资源
      最近更新 更多