V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
xoxo419
V2EX  ›  问与答

小程序 wx.connectSocket 调试模式下可以使用 ip+端口连接么?

  •  
  •   xoxo419 · Oct 11, 2017 · 1315 views
    This topic created in 3123 days ago, the information mentioned may be changed or developed.

    测试代码如下, 但是边报错信息都没有, 开发工具上我也勾选了"开发环境不校验请求域名以及 TLS 版本"

    Page({
    
      onLoad: function () {
        wx.connectSocket({
          url: 'http://ip:8082'
        })
        wx.onSocketOpen(function(res) {
          console.log(res)
        })
        wx.onSocketError(function(res){
          console.log('WebSocket 连接打开失败,请检查!')
        })
      }
    })
    
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5394 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 07:33 · PVG 15:33 · LAX 00:33 · JFK 03:33
    ♥ Do have faith in what you're doing.