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

152
Vistas
How to configure apache to support websockets

I wrote server in python and now I would like to configure apache web server to support websockets. My server returns information when a client sends queries to these addresses:

def make_app():
    return tornado.web.Application([
        (r"/playgame", EmptyGame),
        (r"/playgame/", EmptyGame),
        (r"/playgame/(.*)", PlayerGameWebsocket)
    ])

How to configure the server to support regular user traffic but also to enable websockets when the client establishes such a connection?

I user apache2.4 server.

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

Ok, it turned out that the solution is trivial. If someone ever looked for an answer, just add a simple redirection to the application in the virtual host configuration which listens on localhost:

ProxyPassMatch "/playgame/(.*)" "ws://127.0.0.1:8888/playgame/$1"
ProxyPassReverse "/playgame/(.*)" "ws://127.0.0.1:8888/playgame/$1"

Thanks to such syntax, we can even pass additional data, e.g. "/playgame/123". We connect from the client without specifying the port:

var adr = "ws://serverip/playgame/" + gameid;
var ws = new WebSocket(adr);
over 4 years ago · Santiago Trujillo Denunciar
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