node.js - How to run HTTP server, UDP Server and WebSocket Server from a single NodeJS app? -
as nodejs single threaded runtime platform, how run following servers in parallel within single nodejs app:
- nodejs's http server: serve html5 app
- a websocket server: serve websocket connection html5 app using same http connection opened @ http server.
- udp server: expose service discovery endpoint other independently running nodejs apps on same machine or on other machines/docker containers.
i thinking somehow achieving above using rxjs, rather want listen community solution/experiences.
node.js not single threaded. developer has access thread. under hoods, node.js multi-threaded.
specifically question, can start multiple servers in same process. socket.io getting started example shows running websockets http server. same thing can done udp.
hope helps.
Comments
Post a Comment