简体   繁体   English

无法使用来自 LAN 中 Unix 系统的 Websocket 从客户端连接 Node.js/Socket.io 服务器

[英]Not able to connect Node.js/Socket.io Server from a Client using Websocket from a Unix System in a LAN

I have written a client application in C++ using websockets in Unix Environment trying to connect a Node.js/Socket.IO server running in a LAN connectivity.我在 Unix 环境中使用 websockets 用 C++ 编写了一个客户端应用程序,试图连接在 LAN 连接中运行的 Node.js/Socket.IO 服务器。 I found the server application is not responding at all.我发现服务器应用程序根本没有响应。 I tried a couple of other options from client side eventually getting no response from the server.我从客户端尝试了几个其他选项,最终没有得到服务器的响应。 Basically, i am trying to send a JSON object to the system running SocketIO server, but the client is not getting connected even if the server listens on to a Port.基本上,我正在尝试向运行 SocketIO 服务器的系统发送一个 JSON 对象,但即使服务器侦听端口,客户端也无法连接。 Help, is really appreciated.帮助,真的很感激。 Thank you.谢谢你。

Make sure following has been checked-确保已检查以下内容-

  1. Server running and port is open (firewall) - Client is unable to connect the server服务器正在运行且端口已打开(防火墙) - 客户端无法连接服务器
  2. Url is correct - Client is unable to connect or url not exist网址正确 - 客户端无法连接或网址不存在
  3. Listener code or receiving task is running - Client connected but when server send data to client, client didnot receive data侦听器代码或接收任务正在运行 - 客户端已连接,但当服务器向客户端发送数据时,客户端未收到数据
  4. JSON format is correct and json data does not contain invalid character - client send data server but server did not received JSON 格式正确且 json 数据不包含无效字符 - 客户端发送数据服务器但服务器未收到

Follow - remove date if exists into msg for test purpose, use " to prepare JSON data, donot put / end of the url if not required. example- 1. Write url as ws://abc.com:8080/wsserver 2. JSON data as {"name":"myname","yourname":"indo","msg":"birthday"}按照 - 删除日期(如果存在于 msg 中以用于测试目的,使用 " 准备 JSON 数据,如果不需要,则不要在 url 的末尾放置。示例- 1. 将 url 写为 ws://abc.com:8080/wsserver 2. JSON 数据为 {"name":"myname","yourname":"indo","msg":"birthday"}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM