- Home /
How to run uNET (Unity Networking) Host Server for WebGL build - Unity 5.3.4f1
So I have a game that I want to export to WebGL. It uses Unity's latest networking solution uNET (Unity Networking) and I've selected the *use websockets option.
Currently, WebGL clients cannot be a server. Thus in order to host a game, I am doing it when I run the game through the editor. Then in the browser, I can join the game as a client.
So obviously I don't want to leave my computer on to be the host through the editor while people in the web join as clients.
I'm thinking that I should build the game in standalone and run the standalone game on some server and join the game as host. Then of course I leave the server on 24/7 so anyone can join through the web. But I have no idea how to accomplish this (i.e. what services to use) or if this is even the right approach.
Hi, this is not an answer but a update of your post. I have the same problem ! Did you, or anybody, find a solution ? Thanks
Unfortunately I haven't found a solution to this particular problem.
But in general my problem was having a networking solution for Unity games over the web. I've found that you can interact with Unity's code using
Send$$anonymous$$essage("OBJECT_NA$$anonymous$$E", "$$anonymous$$ETHOD_NA$$anonymous$$E"); in client-side javascript.
As a result, I'm using Firebase as a networking solution and database. You can use any other service as well but I've found the resources from Firebase to be quite generous.
I found this five $$anonymous$$utes ago : https://community.unity.com/t5/$$anonymous$$ultiplayer-Networking/StartServer-listen-failed-error-with-UNET-and-WebGL/td-p/2563574
Thanks for yours informations.
Here's more information on Send$$anonymous$$essage();
https://docs.unity3d.com/$$anonymous$$anual/webgl-interactingwithbrowserscripting.html
Answer by RogueMacro · Nov 12, 2018 at 06:40 AM
I don’t know if you still want answers, but for those others seeing this question. Check out this question with a good answer: WebGL cannot be server?
Your answer
Follow this Question
Related Questions
Is it possible to get a networked WebGL build to run in single player mode? 2 Answers
Best way to check if connected to the internet from a webGl build? 0 Answers
How to connect to server with a WebGL Build using Unity's Multiplayer Service, Unity 1 Answer
New UnityWebRequest How Can I Handle the responses ?? 1 Answer
Adding Custom Headers/Cookies to the UnityWebRequest.Post 1 Answer