소스 검색

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(),