浏览代码

https config

zhangweicheng 7 年之前
父节点
当前提交
926d93b995
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      public/web/socket/connection.js

+ 2 - 1
public/web/socket/connection.js

@@ -7,7 +7,8 @@ socketObject={
       // 连接socket服务器
       var hostName = window.location.hostname;
       let me = this;
-      socket = io('http://'+hostName+':3300');
+      let port = window.location.protocol ==='http:'?3300:3301
+      socket = io(window.location.protocol+'//'+hostName+':'+port);
       socket.on('connect', function () {
           me.roomInfo={
               feeRate:me.getFeeRateRoomID(),