engine.io

Node.js + Socket.io | Set custom headers on the server

独自空忆成欢 提交于 2020-01-02 09:39:09
问题 I use Helmet with Express to set quite some security HTTP headers from the server side. This is nicely done, when rendering client pages on top of the node.js app, using: var app = express(); app.use(helmet()); .. res.render("pages/index", data); All the resources on the index page will have the Helmet headers. Unfortunately, socket.io does its own header management. So, anything that comes after /socket.io/ will have insecure/its own headers. For example here: <https_path>/socket.io/socket

Forwarding socket.io/engine.io connection to another server

给你一囗甜甜゛ 提交于 2019-12-25 09:01:56
问题 We are trying to find the best approach to our load balancing issue with websockets. Websocket can initially connect to any server, that server will run some logic and then if needed it will "redirect" the client to appropriate server. Is there a way in socket.io/engine.io to redirect/forward connections? Something like: io.use(function(socket){ // ... logic if(logic === true){ socket.redirect("172.10.10.2:3000"); } }); I am aware of that socket.redirect is not valid function but is there

Which websocket library to use with Node.js? [closed]

青春壹個敷衍的年華 提交于 2019-12-17 02:01:35
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 2 years ago . Currently there is a plethora of websocket libraries for node.js, the most popular seem to be: https://github.com/Worlize/WebSocket-Node https://github.com/einaros/ws https://github.com/LearnBoost/engine.io https://github.com/learnboost/socket.io https://github.com/sockjs However I can't find any solid concrete

Node.js + Socket.io | Set custom headers on the server

*爱你&永不变心* 提交于 2019-12-06 09:46:58
I use Helmet with Express to set quite some security HTTP headers from the server side. This is nicely done, when rendering client pages on top of the node.js app, using: var app = express(); app.use(helmet()); .. res.render("pages/index", data); All the resources on the index page will have the Helmet headers. Unfortunately, socket.io does its own header management. So, anything that comes after /socket.io/ will have insecure/its own headers. For example here: <https_path>/socket.io/socket.io.js <https_path>/socket.io/?EIO=3&transport=polling&t=Lj4CFnj&sid=ILskOFWbHUaU6grTAAAA Hence, I want

Which websocket library to use with Node.js? [closed]

断了今生、忘了曾经 提交于 2019-11-26 10:56:47
Currently there is a plethora of websocket libraries for node.js, the most popular seem to be: https://github.com/Worlize/WebSocket-Node https://github.com/einaros/ws https://github.com/LearnBoost/engine.io https://github.com/learnboost/socket.io https://github.com/sockjs However I can't find any solid concrete comparisons between any of them... Apparently Socket.io was awesome, but has become quite dated and has failing builds. Both ws and websocket-node claim they are the fastest. And engine.io seems new, but a lot heavier than the lighter aletarntives. It would be amazing if we or someone