I'm running a Minecraft server network for my friends, where I host servers for them. They can interact with their server using a control panel in the browser.
I'm attempting to allow the browser to directly connect to my network using WebSockets. The network manager program (aka the bot) is setup to receive connections on port 50000. My website, example.com, redirects mc.example.com to my computer's ip, using A records. The control panel then connects to mc.example.com:50000. Minecraft servers are on different ports, like mc.example.com:50001.
Since https requires wss, I need to setup a trusted certificate on the WebSocket server. My plan was to copy the SSL certificate from the mc.example.com domain to the bot, allowing the connection.
However, AutoSSL will not generate a certificate for mc.example.com, since it is unable to connect to port 80.
Is it possible to allow AutoSSL to run, while still redirecting most ports to my custom ip? Or more broadly, how can I allow the control panel to connect to the bot via wss?
According to this documentation, WebSockets should be redirected with SRV records for _wss and _ws services.
* All of these tests were with ws, as I didn't have the certificate yet, and it was easier
The browser is using the standard JavaScript WebSocket.
The bot is a Java program using a WebSocket library, that is wrapped in a custom packet library. The port forwarding and related stuff is working; I can get a ws connection to go through.
The website hoster is Bluehost (shared hosting), so I can't use a standard port forward, website-server-side.
I believe stackoverflow is the correct stack exchange site for this, as I accept and welcome solutions that require programming on either end. (Ex.: a JavaScript variable I can change to check for SRV records.) Please let me know if there is a better one.
Edit: I have managed to get this to work by setting up a port forwarded XAMPP server, which uses a .htaccess file to redirect back to example.com/mc.
However, I am open to much cleaner solutions.