- Home /
Unity WebSocket Client
I have a NodeJS Websocket server and I need to create a connection between Unity and NodeJS, but I can't find a way to create the script to act as a client in Unity. How could I create the Client script in Unity to connect to the NodeJS server via WebSocket?
Answer by sacredgeometry · Nov 30, 2020 at 01:00 AM
If you are not bedded into the NodeJs implementation you may want to investigate SignalR. Its probably the most mature .NET websockets implementation.
https://dotnet.microsoft.com/apps/aspnet/signalr
Failing that you can try something like these:
https://thecodegarden.net/websocket-client-dotnet
https://www.codemag.com/article/1210051/Real-Time-Web-Apps-Made-Easy-with-WebSockets-in-.NET-4.5
Answer by CmdrZin · Nov 30, 2020 at 04:57 PM
I have several examples on https://github.com/CmdrZin/NodeJS But basically you add Socket IO from the Asset store and reference the SocketIOComponent.
Your answer
Follow this Question
Related Questions
How to receive message from NetworkConnection 1 Answer
Occasionally issue with Wifi connection 0 Answers
OnConnectedToServer not working 1 Answer
Why I cant use 2 NetworkManagers in the same time? 0 Answers
Insert Wi-Fi settings in Unity APP 0 Answers