Socket.IO

node.js + socket.io - duplicate websocket writes?

喜欢而已 提交于 2019-12-31 03:02:29
问题 I'm new to the node.js and socket.io scene, so this may be a simple fix... but here goes. I have the following POC for taking in messages via UDP and echoing them back to a browser. UDP messages are received on 55555, a websocket write is performed, and the client sees the data in their browser. However, the moment another client connects to the server, four websocket writes are performed when a datagram is received - two to each client I believe, as the appended data now shows up twice .

Client-side socket.io without a node.js server

╄→гoц情女王★ 提交于 2019-12-30 17:24:51
问题 To use socket.io on the client side, usually we start a node.js server and go like this: <script src="/socket.io/socket.io.js"></script> or with specific port: <script src="http://localhost:3700/socket.io/socket.io.js"></script> Question is: is it necessary to use node.js server to serve socket.io.js ? ...or is it possible to make a local copy of socket.io.js instead of goes to server every single time we need socket.io? like, we go to view source and copy everything we got from the source of

Client-side socket.io without a node.js server

a 夏天 提交于 2019-12-30 17:24:06
问题 To use socket.io on the client side, usually we start a node.js server and go like this: <script src="/socket.io/socket.io.js"></script> or with specific port: <script src="http://localhost:3700/socket.io/socket.io.js"></script> Question is: is it necessary to use node.js server to serve socket.io.js ? ...or is it possible to make a local copy of socket.io.js instead of goes to server every single time we need socket.io? like, we go to view source and copy everything we got from the source of

How to run socket.io (client side only) on apache server

自古美人都是妖i 提交于 2019-12-30 12:34:56
问题 I want to run client side of socket.io on my apache server. I have uploaded the socket.io directory to my web server and tried the simple client connection example from the main site socket.io but its not working. I dont know what do I need to get it work and connect my running server. I Hope, I have clearly explained my problem. Thank you. 回答1: Copy all the files in socket.io\node_modules\socket.io-client\dist to your apache server for example to the js folder. Then add the socket.io.min.js

How to run socket.io (client side only) on apache server

青春壹個敷衍的年華 提交于 2019-12-30 12:33:00
问题 I want to run client side of socket.io on my apache server. I have uploaded the socket.io directory to my web server and tried the simple client connection example from the main site socket.io but its not working. I dont know what do I need to get it work and connect my running server. I Hope, I have clearly explained my problem. Thank you. 回答1: Copy all the files in socket.io\node_modules\socket.io-client\dist to your apache server for example to the js folder. Then add the socket.io.min.js

socket.io client to client messaging

百般思念 提交于 2019-12-30 11:47:12
问题 I'm having trouble getting basic client to client (or really client->server->client) working with socket.io. Heres the code I have right now: io.sockets.on('connection', function (socket) { users.push(socket.sessionId); for(userID in users) { console.log(userID); io.sockets.socket(userID).emit('message', { msg: 'New User Connected succesfully' }); } socket.emit('message', { msg: 'Connected succesfully' }); socket.on('my other event', function (data) { console.log(data); }); }); From my

C client for socket.io

风流意气都作罢 提交于 2019-12-30 11:27:14
问题 I am trying to establish a connection from a program in C to a node server with socket.io. The only way I could figure out was to make http request from the C program to the node server so I have dis part a little covered. Now I need to receive some information from the node server from the C program. Is there any client library for c that lets me do this? In case it does not exist, could you gime me some ideas to make it work? Thank you very much! 回答1: You can also try cellophane.io: https:/

info - unhandled socket.io url

天大地大妈咪最大 提交于 2019-12-30 10:35:30
问题 I working on a socket.io + node project. Just like in this page, http://davidwalsh.name/websocket I am getting "info - unhandled socket.io url" error in socket.io v7. But I dont get this error with v6.17? Do you have any idea with this error? Thanks 回答1: Had the exact issue couple of days back and looks like socket.io had some changes in the API. I have a working demo of socket.io sending and receiving a message - uploaded to https://github.com/parj/node-websocket-demo as a reference

info - unhandled socket.io url

*爱你&永不变心* 提交于 2019-12-30 10:35:03
问题 I working on a socket.io + node project. Just like in this page, http://davidwalsh.name/websocket I am getting "info - unhandled socket.io url" error in socket.io v7. But I dont get this error with v6.17? Do you have any idea with this error? Thanks 回答1: Had the exact issue couple of days back and looks like socket.io had some changes in the API. I have a working demo of socket.io sending and receiving a message - uploaded to https://github.com/parj/node-websocket-demo as a reference

Why is my socket.io using long polling instead of the websocket?

a 夏天 提交于 2019-12-30 08:01:32
问题 So I set up socket.io with a NodeJS + ExpressJS server and everything is working well. The only problem is I just realized that my emit() calls are using the fallback XHR method to send the event to my server rather than the websocket connection it has open. When I view the connection, all I see are some 2probe , 3probe , followed by a bunch of 2's and 3's being sent across the websocket. This connection appears to be open and working, so why is it falling back to long polling with XHR