某些网络中的 Socket.io 错误

发布于 2024-11-04 23:50:38 字数 1092 浏览 0 评论 0原文

我在某些网络中使用 socket.io 时遇到问题。

我用来测试这个的演示页面和节点服务器最初是在 此处此处 。它是socket.io提供的一个简单的聊天客户端。

当用户从某些封闭网络(例如办公室或大学)访问我的服务器上的此演示页面时,用户会反复连接和断开连接,直到最终断开连接。在此期间 Node.js 的输出是:

3 May 07:50:41 - Initializing client with transport "jsonp-polling"
3 May 07:50:41 - Client 16640139906667173 connected
3 May 07:50:41 - Initializing client with transport "jsonp-polling"
3 May 07:50:41 - Client 6106549079995602 connected
3 May 07:50:41 - Initializing client with transport "jsonp-polling"
3 May 07:50:41 - Client 8987158865202218 connected
3 May 07:50:42 - Initializing client with transport "jsonp-polling"
3 May 07:50:49 - Client 16640139906667173 disconnected
3 May 07:50:49 - Client 8987158865202218 disconnected
3 May 07:50:49 - Client 6106549079995602 disconnected

这将持续到浏览器放弃并永久断开连接。

以前有人遇到过类似的问题吗?什么可能导致 socket.io 在特定网络内失败?

谢谢。

I am experiencing problems using socket.io from within certain networks.

The demo page and node server I am using to test this are originally found here and here. It is a simple chat client provided by socket.io.

When a user accesses this demo page on my server from within certain closed networks such as an office or university, the user connects and disconnects repeatedly until it finally drops the connection. The output from Node.js during this is:

3 May 07:50:41 - Initializing client with transport "jsonp-polling"
3 May 07:50:41 - Client 16640139906667173 connected
3 May 07:50:41 - Initializing client with transport "jsonp-polling"
3 May 07:50:41 - Client 6106549079995602 connected
3 May 07:50:41 - Initializing client with transport "jsonp-polling"
3 May 07:50:41 - Client 8987158865202218 connected
3 May 07:50:42 - Initializing client with transport "jsonp-polling"
3 May 07:50:49 - Client 16640139906667173 disconnected
3 May 07:50:49 - Client 8987158865202218 disconnected
3 May 07:50:49 - Client 6106549079995602 disconnected

This continues until the browser gives up and permanently drops the connection.

Has anyone experienced similar issues before? What could cause socket.io to fail from within specific networks?

Thank you.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

初吻给了烟 2024-11-11 23:50:38

某些办公室/大学网络会过滤掉高于已知端口阈值 (1024+) 的端口。这可以防止用户使用 P2P 软件(包括 8080)并减少网络堵塞。我建议将聊天客户端端口更改为该范围内的端口或众所周知的端口,可能我的选择是 81-90。

Some office/university networks filter out ports above the well-known port threshold (1024+). This prevents users from using P2P software (which includes 8080) and provides a less clogged network. I would suggest changing the chat client port to something within that range or something well known, possibly 81-90 would be my choice.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文