【问题标题】:react native socket.io-client doesn't connected to https server on Release buildreact native socket.io-client 在 Release 构建时未连接到 https 服务器
【发布时间】:2020-03-09 07:09:15
【问题描述】:

反应原生信息

System:
    OS: Windows 10 10.0.18363
    CPU: (8) x64 Intel(R) Core(TM) i5-8265U CPU @ 1.60GHz
    Memory: 8.28 GB / 15.85 GB
  Binaries:
    Node: 12.14.1 - C:\Program Files\nodejs\node.EXE
    npm: 6.13.4 - C:\Program Files\nodejs\npm.CMD
  IDEs:
    Android Studio: Version  3.5.0.0 AI-191.8026.42.35.6010548
  npmPackages:
    react: 16.9.0 => 16.9.0
    react-native: ^0.61.5 => 0.61.5

socket.io-client 版本

"socket.io-client": "^2.3.0",

我的代码

const EVENT_SERVER = 'https://my.prod.server';

socketInstance = SocketIOClient(EVENT_SERVER, {
    forceNew: false,
    transports: ['websocket'],
    reconnection: true,
  });

问题

如果我构建 debug mode 连接到我的 https 服务器。但release mode 无法连接到我的https 服务器。

我能做什么?给我一些建议..!

【问题讨论】:

    标签: react-native https socket.io release


    【解决方案1】:

    我解决了这个问题!

    问题是console.dir()function console.dir()function 不支持释放模式。

    【讨论】:

      猜你喜欢
      • 2021-03-31
      • 1970-01-01
      • 2015-05-20
      • 2015-11-12
      • 2020-06-01
      • 1970-01-01
      • 2020-05-11
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多