I want to add on an existing project some sockets with nodeJs and Socket.io. I already have 2 servers :
- An API RESTful web service, to storage and manage my datas.
- A Public web service to return HTML, assets (js, css, images, ...)
On the first try, I create my socket server on the Public one. But I think it will be better if I create an other one to handle only socket query.
What do you think ? It's a good idea or just an useless who will add more problem than solve (maybe duplicate intern lib, ..)
Also, i'm using token to communicate between Public and API, do I have to create another to communication between socket and API ? Or I can use the same one ?
------[EDIT]------
As nobody didn't understand me well I have create a schema with the infrastructure I was thinking about.
- It is a good way to proceed ?
- The Public Server and Socket server have to be the same ? Or can be separate ?
- Do I must create a socket connection between API and Socket server for each client connected ?
Thank you !