gpt4 book ai didi

node.js - Socket.io 在某些机器上无法工作

转载 作者:太空宇宙 更新时间:2023-11-04 02:42:41 25 4
gpt4 key购买 nike

我从 Socket.io 开始,我制作了一个快速示例应用程序,大多数事情似乎都正常。然而,当我在办公室的另一台电脑上测试它时,它不起作用。我无法确定问题或共同点。它可以在运行 Chrome 和 Firefox 的 iMac 以及运行 Firefox 15.0.1 的 Windows 计算机上运行。

但是在另外 2 台机器上它不起作用,它们运行 Firefox 15.0.1 和最新的 Chrome。他们可以连接并接收广播,但不会发送任何广播。

socket.io 提供的示例应用程序面临同样的问题,所以我知道我的代码不是问题。

服务器是机架空间虚拟机。所有计算机共享相同的 IP 地址,这会是问题吗?

谢谢。

Connection I5m-GX0YxKk-fsqkaDYr accepted.
debug - emitting heartbeat for client I5m-GX0YxKk-fsqkaDYr
debug - websocket writing 2::
debug - set heartbeat timeout for client I5m-GX0YxKk-fsqkaDYr
debug - got heartbeat packet
debug - cleared heartbeat timeout for client I5m-GX0YxKk-fsqkaDYr
debug - set heartbeat interval for client I5m-GX0YxKk-fsqkaDYr
debug - client authorized
info - handshake authorized 2_OfnBCUPoO1TuWUaDYs
debug - setting request GET /socket.io/1/websocket/2_OfnBCUPoO1TuWUaDYs
debug - set heartbeat interval for client 2_OfnBCUPoO1TuWUaDYs
debug - client authorized for
debug - websocket writing 1::
Connection 2_OfnBCUPoO1TuWUaDYs accepted.
debug - setting request GET /socket.io/1/xhr-polling/2_OfnBCUPoO1TuWUaDYs?t=1347888419067
debug - setting poll timeout
debug - discarding transport
debug - cleared heartbeat interval for client 2_OfnBCUPoO1TuWUaDYs
debug - emitting heartbeat for client I5m-GX0YxKk-fsqkaDYr
debug - websocket writing 2::
debug - set heartbeat timeout for client I5m-GX0YxKk-fsqkaDYr
debug - got heartbeat packet
debug - cleared heartbeat timeout for client I5m-GX0YxKk-fsqkaDYr
debug - set heartbeat interval for client I5m-GX0YxKk-fsqkaDYr
debug - setting request GET /socket.io/1/jsonp-polling/2_OfnBCUPoO1TuWUaDYs? t=1347888429074&i=0
debug - setting poll timeout
debug - discarding transport
debug - clearing poll timeout
debug - clearing poll timeout
debug - jsonppolling writing io.j[0]("8::");
debug - set close timeout for client 2_OfnBCUPoO1TuWUaDYs
debug - jsonppolling closed due to exceeded duration
debug - emitting heartbeat for client I5m-GX0YxKk-fsqkaDYr
debug - websocket writing 2::
debug - set heartbeat timeout for client I5m-GX0YxKk-fsqkaDYr
debug - got heartbeat packet
debug - cleared heartbeat timeout for client I5m-GX0YxKk-fsqkaDYr
debug - set heartbeat interval for client I5m-GX0YxKk-fsqkaDYr
debug - setting request GET /socket.io/1/jsonp-polling/2_OfnBCUPoO1TuWUaDYs?t=1347888449506&i=0
debug - setting poll timeout
debug - discarding transport
debug - cleared close timeout for client 2_OfnBCUPoO1TuWUaDYs
^Croot@nodejs:~# node socket
info - socket.io started
debug - client authorized
info - handshake authorized R840LL5ZZes1YFB_aZS8
debug - discarding transport
debug - jsonppolling received data packet �17�3:::Hello Server!�17�3:::Hello Server!
debug - client authorized
info - handshake authorized ycWCnVfgTTLAdi0maZS9
debug - client authorized
info - handshake authorized av8ttHujRRMUNdZWaZS-
debug - setting request GET /socket.io/1/websocket/av8ttHujRRMUNdZWaZS-
debug - set heartbeat interval for client av8ttHujRRMUNdZWaZS-
debug - client authorized for
debug - websocket writing 1::
Connection av8ttHujRRMUNdZWaZS- accepted.
^Croot@nodejs:~# node socket
info - socket.io started
debug - client authorized
info - handshake authorized tod2RUk4cC6njt7_ab1d
debug - setting request GET /socket.io/1/websocket/tod2RUk4cC6njt7_ab1d
debug - set heartbeat interval for client tod2RUk4cC6njt7_ab1d
debug - client authorized for
debug - websocket writing 1::
Connection tod2RUk4cC6njt7_ab1d accepted.
debug - client authorized
info - handshake authorized Bm2b5koW4OhwMN0Uab1e
debug - setting request GET /socket.io/1/websocket/Bm2b5koW4OhwMN0Uab1e
debug - set heartbeat interval for client Bm2b5koW4OhwMN0Uab1e
debug - client authorized for
debug - websocket writing 1::
Connection Bm2b5koW4OhwMN0Uab1e accepted.
debug - setting request GET /socket.io/1/xhr-polling/Bm2b5koW4OhwMN0Uab1e?t=1347888478540
debug - setting poll timeout
debug - discarding transport
debug - cleared heartbeat interval for client Bm2b5koW4OhwMN0Uab1e
debug - emitting heartbeat for client tod2RUk4cC6njt7_ab1d
debug - websocket writing 2::
debug - set heartbeat timeout for client tod2RUk4cC6njt7_ab1d
debug - got heartbeat packet
debug - cleared heartbeat timeout for client tod2RUk4cC6njt7_ab1d
debug - set heartbeat interval for client tod2RUk4cC6njt7_ab1d
debug - setting request GET /socket.io/1/jsonp-polling/Bm2b5koW4OhwMN0Uab1e?t=1347888488546&i=0
debug - setting poll timeout
debug - discarding transport
debug - clearing poll timeout

最佳答案

我部分解决了这个问题。防病毒程序阻止了一些计算机上的 Web 套接字连接。我花了一段时间才发现这个问题,因为 http://websocketstest.com/显示所有端口均已打开,并且软件显示没有事件的防火墙。然而,当退出防病毒程序时,一切又开始工作。

不知道为什么 http://websocketstest.com/显示所有端口均已打开。暂时切换到843端口。

谢谢

关于node.js - Socket.io 在某些机器上无法工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12458212/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com