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:

  1. nodejs's http server: serve html5 app
  2. a websocket server: serve websocket connection html5 app using same http connection opened @ http server.
  3. 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

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -