Tag: 窗口应用程序

Windows 8应用程序和nodejs websocket不能相互连接

我正在使用Windows应用程序,并尝试将其连接到节点服务器。 我在Windows应用程序中使用Web套接字,而从npm节点使用“websocket”。 我有麻烦连接两个似乎在那里连接,但当我试图发送信息(简单的Hello Worldstring)没有任何反应。 我有一个简单的JavaScript的Windows应用程序。 在我的default.html中只有一个简单的button: <button onclick="Check()">Check status</button> 在default.js我有检查function是: function Check() { var host = "ws://192.168.201.91:8080"; try { socket = new WebSocket(host); socket.onopen = function (openEvent) { console.log("Sockets open"); socket.send("Hello, world"); console.log("Socket state: " + socket.readyState); console.log("Message is sent to: " + socket.url); }; socket.onerror = function (errorEvent) { console.log(" 'WebSocket Status:: Error was […]