Readme update would be wonderful
WS/WSS/WebGL docs:
How to test Bayou locally with WSS enabled, for example, such as generating/including a local certificate (perhaps Editor as server, Webgl as client)? There are too many mysterious restrictions for WebGL - updating the readme here would rock. Some restrictions, cans/cants/etc.
For example, I only recently discovered you can't run WS in host mode in a webgl standalone, but you can in Editor. Then when it comes to WSS, there are even more nuances. Some TCP servers don't support WS, apparently --
I understand that some of this may be beyond the scope of the Transport, itself, but how to connect the dots is scattered all over the internet. After researching this, myself, it's been quite the struggle. Unity WebGL/WS/WSS restrictions and requirements, how to localhost test, etc.
There's also a separate checkbox for "Use Wss" and "Ssl Configuration Enabled" -- I didn't even know you can use WSS without SSL.
As for Certificate Path, path/to/the build exe? cert.pfx or ./cert.pfx? Some examples would be great.
SSL protocol - I didn't know there were so many. How can I tell which I'm using (or the remote server is using, if it's a 3rd-party)? What about localhost testing?
I'm just not quite sure how to test this properly without trial-and-error and 3rd-party scattered resources that all say different things, but none exclusive to Unity's WebGL that seems to have its own exceptions :)
As an update, I came to the realization that if you're uploading to a 3rd-party server that already has TLS, you don't actually need to check the SSL opts -- in fact, you simply turn on WSS and that's it.
I wildly overthought that since my mindset was that TLS must have SSL, so of course I need to enable it - and went down a wild path of SSL cert research😄 oops!
Indeed, let's help other folks with some high level tips.
Did you find a solution to open a server in WebGL?
Did you find a solution to open a server in WebGL?
I did not :( I tried everything. Toss me a ping if you get it working. I couldn't get it working with Mirror, either.
It's definitely possible it's my own issue, but I noticed that Bayou (FishNet) also uses SimpleWebTransport (Mirror), so it's still very possible it's not my issue.
I can get all other transports working np; even WebGL with TLS (WSS). Just not WebGL with TCP (WS).
I could include this git in the read me https://github.com/celojevic/FishNet-WebGL-WSS-SSL-Example
In the end the solution is pretty simple.
- WSS is WS with SSL, I tried to proxy it with nginx to get a cert, but that didn't work. You need to open the Websocket port directly - at least if you think its not working - and you need to serve the cert with the setting in Unity>Fishnet>Bayou
- lets encrypt certificates only work when generated with old (RSA) method, new EDCSA cert will not work (there might be working way with new .NET Versions that support EDCSA but could not make it work)
- WS is most like not going to work then you serve your page with HTTPS, as HTTPS pages will not load any content from unsecured sites sockets ie HTTP or WS
@FirstGearGames You could include this https://fish-networking.gitbook.io/docs/manual/components/transports/bayou in the readme
Side note, the transport settings aren't all clear;
Enable WSS:is only for clients. (Could do with a better variable name, or at least a[Header("Only for clients connecting to servers")]- It seems like all the SSL setup for the server, only applies with
UNITY_SERVER, which is only for headless builds? Seems like a pointless distinction (I will still want SSL if I've ticked SSL - for testing servers locally, in editor, or if I can't build a dedicated server exe... or as in our case, I use the same exe for servers and clients)