If I want to use websocket in my project, whether there need two gateways? #1190
-
In my requirement, I will use both normal HTTP request and websocket request in my project, such as, moleculer-web + moleculer-socketio ? like below: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
First of all, the moleculer-io is the official Socket.io library. You can use the moleculer-web HTTP server as the server of the moleculer-io as well, so no need to start two HTTP server. |
Beta Was this translation helpful? Give feedback.
First of all, the moleculer-io is the official Socket.io library.
You can use the moleculer-web HTTP server as the server of the moleculer-io as well, so no need to start two HTTP server.
More info: https://github.com/moleculerjs/moleculer-io#init-server
Or real example: https://github.com/icebob/kantab/blob/master/backend/services/api.service.js