My Unity project uses the Mirror Networking component and I am using an AWS free tier EC2 instance to host it. I configured the instance following this guide from the Mirror documentation, including adding a security rule to open port 7777, the default port used by Mirror. One difference is that I use a Windows build on the server as the host rather than a dedicated server build because I am unable to build the project as a dedicated server build without running into issues.
When I run the server on the AWS instance and try to connect a client to it, I get the error:
"[SimpleWebTransport] EXCEPTION: SocketException Message: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
UnityEngine.Logger:Log (UnityEngine.LogType,object)".
The error is hard to find a solution for because it very generic. I am using the SimpleWebTransport since I want WebGL clients to be able to connect. Portchecker tells me that port 7777 (for Mirror) and 22 (for SSH) are closed, but 3389 for remote desktop protocol is open and I can connect to the instance through RDP. It seems weird that port 7777 would be closed despite me adding a security rule for it to be open but the Mirror documentation said that the port would only be open when the game is running, so I am unsure if this is an issue with my AWS configuration or the game.