mobile CCTV,mobile surveillance,police body worn cameras

标题: jsw-session.js:81 WebSocket connection to 'ws://61.191.27.18:9443/jswapi' fai... [打印本页]

author: 王颖    time: 2020-6-16 16:33
标题: jsw-session.js:81 WebSocket connection to 'ws://61.191.27.18:9443/jswapi' fai...

Start Jsw Init
dependency_mgr.js:40 GET http://localhost:8762/youshi/js/jswlib/thlib/HttpFlv/codec/libffmpeg_265.js net::ERR_ABORTED 404 (Not Found)
jSWUtils.js:364 using broswer websocket
jSWProtocol.js:43 ws url: ws://61.191.27.18:9443/jswapi
jsw-session.js:176 websoket connect ...
jsw-session.js:81 WebSocket connection to 'ws://61.191.27.18:9443/jswapi' failed: Error during WebSocket handshake: Unexpected response code: 400
jsw-session.js:195 http websoket connect closed:1006 reason:
jsw-session.js:226 session did not login, should not reconnect




<script src="../Jquery/jquery-3.1.1.min.js"></script>
<script src="BootStrap4.0.0/bootstrap.min.js"></script>
<script src="../js/jsw.js"></script>
<link rel="stylesheet" type="text/css" href="logindemo.css"/>
<link rel="stylesheet" type="text/css" href="BootStrap4.0.0/bootstrap.min.css" />
window.onload = function () {
  jSW.swInit({
    url: 'https://61.191.27.18:9443', // bv_nginx.exe服务器地址
    calltype: jSW.CallProtoType.AUTO, // AUTO: IE优先使用OCX, 如果希望IE仍然使用HTTP通信, 请使用jSW.CallProtoType.HTTP
  });
};
window.onbeforeunload = function () {
  jSW.swDeInit();
};

var session = null;
  /*手动登录*/
function testLogin() {
  if (session) {
    delete session;
  }
  session = new jSW.SWSession({
    server: '61.191.27.18', // 如果是jSW.CallProtoType.OCX方式,这里需要填写具体的IP
    port: 9701,
    onopen: function (sess) {
      sess.swLogin({
        user: 'test',
        password: '123'
      });
    }
  });

  // 注册事件的回调函数
  session.swAddCallBack('login', function (sender, event, json) {
    alert(JSON.stringify(json, null, 4));
  });
  session.swAddCallBack('logout', sessionCallback);
  session.swAddCallBack('pulist', sessionCallback);

author: jsb    time: 2020-6-16 16:39
当前在用的web服务是什么版本的
author: 王颖    time: 2020-6-16 18:35
这个问题是因为请求了 http 而不是 https,已经解决
author: hardfire    time: 2020-6-17 04:00
感谢分享




欢迎光临 mobile CCTV,mobile surveillance,police body worn cameras (http://bbs.besovideo.com:8067/) Powered by Discuz! X3.2