Is it possible to have a Socket.io connection between two backend files, with no Client involved? #4941
Answered
by
darrachequesne
respectabiggle
asked this question in
Q&A
-
Thank you! Starting code here: https://github.com/respectabiggle/socketIoServerToServer |
Beta Was this translation helpful? Give feedback.
Answered by
darrachequesne
Feb 5, 2024
Replies: 2 comments 3 replies
-
Yes! One server can act as a client, and the other one as an actual server. You can also have the two servers act as servers, and then use Reference: https://socket.io/docs/v4/server-instance/#serversideemit |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
darrachequesne
-
Man! Thank you so much! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yes! One server can act as a client, and the other one as an actual server.
You can also have the two servers act as servers, and then use
io.serverSideEmit()
to exchange data between them.Reference: https://socket.io/docs/v4/server-instance/#serversideemit