国产+高潮+在线,国产 av 仑乱内谢,www国产亚洲精品久久,51国产偷自视频区视频,成人午夜精品网站在线观看

web-msg-sender-master跨域名推送

最威武

我有一臺阿里云服務(wù)器 上面部署了web-msg-sender-master 啟動成功 本地調(diào)用 返回值ok 然后我再另外一個ip的服務(wù)器上寫上推送的代碼(這個index.html 驗證過同ip下可用 ) 現(xiàn)在另外一臺ip的項目無法接收到推送消息 請問我怎么寫

3952 5 0
5個回答

walkor 打賞

貼index.html 內(nèi)容

  • 暫無評論
最威武
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<link href="main.css" rel="stylesheet" type="text/css" />
<script src='//cdn.bootcss.com/socket.io/1.3.7/socket.io.js'></script>
<script src='//cdn.bootcss.com/jquery/1.11.3/jquery.js'></script>
<script src='/notify.js'></script>
</head>
<body>

<div class="notification sticky hide">
    <p id="content"> </p>
    <a class="close" href="javascript:"> <img src="/icon-close.png" /></a>
</div>
<div class="wrapper">
    <div style="width:850px;">
    <h3>介紹:</h3>
    <b>Web-msg-sender</b> 234是一個web消息推送系統(tǒng),基于<a rel="nofollow" >PHPSocket.IO</a>開發(fā)。<br><br><br>
    <h3>支持以下特性:</h3>
    <ul>
      <li>多瀏覽器支持</li>
      <li>支持針對單個用戶推送消息</li>
      <li>支持向所有用戶推送消息</li>
      <li>長連接推送(websocket或者comet),消息即時到達</li>
      <li>支持在線用戶數(shù)實時統(tǒng)計推送(見頁腳統(tǒng)計)</li>
    </ul>
    <h3>測試:</h3>
    當前用戶uid:<b class="uid"></b><br>
    可以通過url2222:<a id="send_to_one" hreasf="" target="_blank"><font style="color:#91BD09">http://<font class="domain"></font>:2123?type=publish&to=<b class="uid"></b>&content=消息內(nèi)容</font></a>  向當前用戶發(fā)送消息<br>
    可以通過url:<a  target="_blank"><font style="color:#91BD09">http://<font class="domain"></font>:2123?type=publish&to=&content=消息內(nèi)容</font></a> 想所有在線用戶推送消息<br>
    <script>
        // 使用時替換成真實的uid,這里方便演示使用時間戳
        var uid = Date.parse(new Date());
        $('#send_to_one').attr('href', 'http://123.57.47.152:2123/?type=publish&content=%E6%B6%88%E6%81%AF%E5%86%85%E5%AE%B9&to='+uid);
        $('.uid').html(uid);
        $('.domain').html(document.domain);
    </script>
</div>

 <script>
$(document).ready(function () {
    // 連接服務(wù)端
    var socket = io('http://123.57.47.152:2120');
    // 連接后登錄
    socket.on('connect', function(){
        socket.emit('login', uid);
    });
    // 后端推送來消息時
    socket.on('new_msg', function(msg){
         $('#content').html('收到消息:'+msg);
         $('.notification.sticky').notify();    
    });
    // 后端推送來在線數(shù)據(jù)時
    socket.on('update_online_count', function(online_stat){
        $('#online_box').html(online_stat);
    });
});
</script>

<div id="footer">
<center id="online_box"></center>
<center><p style="font-size:11px;color:#555;"> Powered by <a href="http://wtbis.cn/web-sender" target="_blank"><strong>web-msg-sender!</strong></a></p></center>
</div>
</body>
</html>
  • 暫無評論
walkor 打賞

開下防火墻試下

  • 最威武 2016-01-25

    哪個服務(wù)器的防火墻 index.html的還是 web-msg-sender-master 的

walkor 打賞

發(fā)下測試url吧

  • 暫無評論
最威武

經(jīng)過walkor的解答 原來是notify.js沒有加載到

  • 暫無評論
年代過于久遠,無法發(fā)表回答
??