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

154
Views
Cómo configurar apache para admitir websockets

Escribí el servidor en python y ahora me gustaría configurar el servidor web apache para admitir websockets. Mi servidor devuelve información cuando un cliente envía consultas a estas direcciones:

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

¿Cómo configurar el servidor para admitir el tráfico regular de usuarios pero también para habilitar websockets cuando el cliente establece dicha conexión?

Yo uso el servidor apache2.4.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Ok, resultó que la solución es trivial. Si alguien alguna vez buscó una respuesta, simplemente agregue una simple redirección a la aplicación en la configuración del host virtual que escucha en localhost:

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

Gracias a esta sintaxis, incluso podemos pasar datos adicionales, por ejemplo, "/playgame/123". Nos conectamos desde el cliente sin especificar el puerto:

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