socketio / socket.io

Realtime application framework (Node.JS server)
https://socket.io
MIT License
60.71k stars 10.09k forks source link

MQTT over TCP as an optional transport #5079

Open truongsinh opened 7 years ago

truongsinh commented 7 years ago

You want to:

Status quo

"Transport" only supports ['polling', 'websocket']

Expected implementation

"Transport" supports ['polling', 'websocket', 'mqtt']

Rationale

When developing mobile apps (aka non-web), MQTT over TCP performs much better than HTTP (polling, websocket, or MQTT over websocket), however, like the adoption of websocket, MQTT over TCP might be stopped by firewall. In an ideal scenario, app developers should not care about the transportation, but focus on the logic. Transportation layer should gracefully chooses the best method, given the conditions. Ref https://www.quora.com/Is-MQTT-better-than-HTTP-for-mobile-app-iOS-Android-etc-client-server-communication

Other information:

truongsinh commented 7 years ago

Related to https://github.com/socketio/socket.io/issues/5081

darrachequesne commented 7 years ago

Hi @truongsinh, sorry for the delay! That indeed looks promising, I'll be happy to merge your pull request for that feature.

I'm afraid you'll have to dig a bit into engine.io internals though :muscle:

hearsh commented 5 years ago

hey any update on this?

darrachequesne commented 5 years ago

@hearsh I'm afraid no work has been done on our side yet, I don't know if @truongsinh has had some time to dedicate to it.

mrfelfel commented 3 years ago

add MQTT transport over TCP is not possible (this version of engine.io depends on HTTP(request, URL))

but look at my idea : 1 - serve MQTT broker (Mosca, etc) with node js or any server 2 - implement MQTT transport in engine.io as an independent module 3 - in MQTT transport req data will be emulated