Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

305
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda