Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

299
Views
Redirecting wss:// using DNS to another IP with an SSL certificate

Context

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.

The Problem

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?

What I've tried

  1. Setting up another subdomain, bot.mc.example.com, that redirects to mc.example.com only for the service "_wss" and "_ws" (using SRV records). This allows AutoSSL to run, but doesn't appear to properly redirect the WebSocket. (The browser would connect to bot.mc.example.com:50000.)
  2. Setting up an SRV record for the service "_autossl" or "_ssl" (not sure if these are real) on mc.example.com, to keep only AutoSSL on the normal host server.
  3. Trying to find a way to redirect a range of ports to another ip (didn't find anything)
  4. Some other things I can't remember

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

Other Information

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.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!