#Issue getting webgl to work with HTTPS

120 messages · Page 1 of 1 (latest)

flint stump
#

I have my webgl working just fine with the server on HTTP but it does not work on the HTTPS site. I followed these instructions: https://docs.unity3d.com/Packages/[email protected]/manual/https.html

but it still does not work. I then found this link:
https://github.com/MirrorNetworking/SimpleWebTransport/blob/master/HowToCreateSSLCert.md

but I do not have Unix and I can't seem to find the same thing for Windows.

I then saw this link with the reverse proxy
https://mirror-networking.gitbook.io/docs/manual/transports/websockets-transport

I am not sure if that would fix the issue though.
Any help is appreciated thanks.

GitHub

Contribute to MirrorNetworking/SimpleWebTransport development by creating an account on GitHub.

flint stump
indigo flume
flint stump
flint stump
#

I put 27777 into the port when I built the server.

indigo flume
#

Need to do similar in dashboard of whoever is hosting your server too, e.g. Azure / AWS / etc.

flint stump
flint stump
#

I also ran the game server off the same physical server when I had the client on my webhosting through http with no issues.

indigo flume
#

This isn't in the doc, but you can put this in your custom network manager so you don't have to remember to change it when building server and client:

#if UNITY_SERVER
public override void Start()
{
    ((SimpleWebTransport)Transport.active).port = 27777;
    base.Start();
}
#endif
indigo flume
#

Set your Log Levels in SWT to Verbose and rebuild both server and client, re-deply, clear browser cache, and then see what you get

flint stump
#

Do I have to do something to start the server on the port 27777, or do I just start it like normal? Other than change the port in the transport. Like start it with a -p 27777 or something?

indigo flume
indigo flume
# flint stump

good - you got the 404 that I got when I did a test from here.

#

do you have your index.html in that site root folder?

indigo flume
#

yep that looks right

#

can you show your IIS manager with that site selected?

indigo flume
indigo flume
# flint stump

double click Default Document there - is index.html in the list?

#

meh it must be or you wouldn't get the client...nvm

indigo flume
flint stump
indigo flume
indigo flume
indigo flume
#

not seeing the 404 there in browser console

flint stump
indigo flume
#

You must not have an offline scene assigned since not getting thrown back to start

flint stump
indigo flume
#

not seeing that...odd

flint stump
indigo flume
#

which browser?

flint stump
#

firefox

indigo flume
#

show contents of Build folder

flint stump
indigo flume
# flint stump

Can you find your IIS log from the path shown in Logging there?

flint stump
indigo flume
# flint stump https://pastie.io/aldqle.less

This is what I was looking for
GET / - 7777 - 70.44.62.22 Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/110.0.0.0+Safari/537.36+OPR/96.0.0.0 - 404 4 123 17
Indicates ARR isn't enabled I think

#

instead of the 404 there you should've seen localhost:27777 101 near the end of that line

flint stump
indigo flume
#

you clicked Apply when you changed it, and restarted IIS?

flint stump
indigo flume
flint stump
#

This message came from the server, not sure if it is helpful

indigo flume
#

sounds like they got connected at least - check client for error as to why they might've been kicked.
I'm helping two others - will circle back to this when I can.

indigo flume
#

any luck finding warnings / errors on client? Anything else logging on server?

flint stump
#

That shouldn't change to localhost or anything???

indigo flume
indigo flume
#

Also can try building a server and client of our Basic example (separate project if you don't have Mirror examples in your project) just to rule out it being something in your project.

flint stump
flint stump
indigo flume
#

and direct connecting to the server port with SSL turned off works?

flint stump
#

I had http setup on a webhost using 7778 and I was able to connect and run it for 6 months now

#

server running on same server as now

indigo flume
#

IIS log is showing what now in logs...404, 502, 101?

flint stump
#

2023-03-30 18:19:37 47.87.169.74 GET / - 7777 - 70.44.62.22 Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64;+rv:109.0)+Gecko/20100101+Firefox/111.0 - 502 3 12029 2030

indigo flume
#

This is what you should see...

2023-03-28 02:49:27 W3SVC2 sv8714 1.2.3.4 GET / - 7777 - 1.2.3.4 HTTP/1.1 - - - localhost:27777 101 0 0 7822412 305739 377319
2023-03-28 02:49:27 W3SVC2 sv8714 1.2.3.4 GET / - 7777 - 1.2.3.4 HTTP/1.1 - - - localhost:27777 101 0 0 7910782 310613 383392
2023-03-28 02:49:27 W3SVC2 sv8714 1.2.3.4 GET / - 7777 - 1.2.3.4 HTTP/1.1 - - - localhost:27777 101 0 0 7843026 307434 379389
indigo flume
#

the request is getting past the proxy and into the web site handler (hence logging the browser agent).

#

From this screen....

#

Double Click URL Rewrite...

#

Click Add Rule(s)... [top right]

#

Double Click Reverse Proxy there - do you get any prompt or warning?

flint stump
#

I get this

indigo flume
flint stump
#

no

indigo flume
#

in Bindings, double click the 7777 binding, screenshot it

flint stump
indigo flume
#

yes there - drill into 7777

flint stump
indigo flume
#

k that's right

flint stump
indigo flume
#

It's got to be some little detail someplace - I've set this up on a few different servers with no issues

#

even works on an old Win Server 2012-R2 (yeah twenty-twelve) server

indigo flume
indigo flume
flint stump
indigo flume
flint stump
#

yes

indigo flume
#

7777 with SSL on gives 502 Bad Gateway

flint stump
indigo flume
#

I'm sorry about that...really I am.

#

I'd like to work out what went wrong, but I understand if you don't have the time / interest in pursuing it further.

flint stump
#

Not to mention it isn't https secured right now

indigo flume
#

everything you showed me was like I have all 4 of the servers I've set up

#

When I wrote the guide doc, I started from a virgin server and wrote up every step.

flint stump
#

I have never worked with IIS which doesn't help either

indigo flume
#

on two of the servers I actually have a wildcard so a bunch of server instances can be running on a server on different ports and the rewrite rule forwards to the correct server based on the binding port they connected to by just prepending a 2 to the port

<rule name="Reverse Proxy" enabled="true" stopProcessing="true">
    <match url=".*" />
    <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
        <add input="{SERVER_PORT}" pattern="\d+" />
    </conditions>
    <action type="Rewrite" url="http://localhost:2{C:0}" appendQueryString="false" logRewrittenUrl="true" />
</rule>
#

Then IIS just has bindings for a bunch of ports: 7777, 7778, 7779, etc. and WinAcme keeps the SSL's updated on all of them automatically.