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

270
Vistas
Apache2 + Socket.io reverse proxy : the right way to proceed

this is not a question but a great help difficult to find on the internet,

to correctly configure socket.io with apache2 through websocket requests and not polling requests, here is how to proceed:

First : create your socket.io server like const io = require('socket.io')(yourPort)

Second : add in your favorite vHost these parameters

RewriteEngine On
RewriteCond %{REQUEST_URI}  ^/socket.io            [NC]
RewriteCond %{QUERY_STRING} transport=websocket    [NC]
RewriteRule /(.*)           ws://localhost:yourPort/$1 [P,L]

ProxyPass        /socket.io http://localhost:yourPort/socket.io
ProxyPassReverse /socket.io http://localhost:yourPort/socket.io

(modify yourPort by the correct port where your server listen)

Third : Create your HTML page with

let socket = io.connect('yourWebsite', { transports: ['websocket'] });

Now if you want you can add this in your server for check if it's work

io.on("connection", socket => {
  console.log("it's work !")
})

100% working do not thank me :) Have a nice day.

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