StartServer listen failed error with UNET and WebGL

Hi everybody! I’m using Unity 5.3.4f1 and UNET to add networking to a WebGL game. I plan to eventually build my own matchmaking server so I’m not using the one supplied by Unity.
The problem is I have my NetworkManager object setup to listen using WebSockets.
When the game loads up in WebGL I try to Start a Server using NetworkManager.singleton.StartServer() I get the error message in the browser’s debug console that “StartServer listen failed.”
Can you not use WebSockets without Unity’s matchmaker?
Does this have to be loaded from an external internet address hosted address? (So NOT on LAN or localhost?)
Does UNET NetworkManager not actually support WebSockets? Is there a Unity package I need to add that I am missing? Any help to get me going would really help.

Thanks!

Ok so I realize this was a dumb a question…You can’t host the server via WebGL. So how do I host the Server Application?
Even if I build an OSX application using web sockets I cannot connect to it via another OSX application. It works fine if Web Sockets are not being used. If it was just WebGL unable to connect I’d figure I was doing something minorly wrong. So everywhere I look it claims just check the box and it works using Web Sockets! :frowning: Please help me understand this.

Bump, having the same problem. Any solutions?

You can run standalone application which will work as a host for web browser clients. I understand that it will require additional logic to have implemented

Well, yes, the standalone application works fine. The problem is that your documentation says that once webscokets have been enabled, WebGL should also work fine. Any update on this?

As far as i remeber, your standalone client should work like connection hub and clients should connect to them via web sockets. So, in spite that some of web browser client will serve as server of the game you still need to host some sort of server which will keep web socket connections to each client.

Good news we are going to implement web socket packet relaying soon, probably it will solve your problem. Another possibility is to use web rtc, but we are still unsure are we going support them or not.

Does my answer make sense?

Hey aabramychev, so from what I understand you would have a standalone application (.exe) running on the server to host the games then clients via their browser with WebGL would connect as clients?

@JakeOfSpades yes :slight_smile: