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

364
Views
Autobahn-js no se conecta a Ratchet Server (Wamp)

Ya revisé muchas preguntas y tutoriales y estoy siguiendo la documentación oficial del portal socketme. Estoy ejecutando esto en XAMPP/Localhost.

Websocket funciona cuando no estoy usando la interfaz WAMP. De lo contrario, no se puede conectar y no indica ningún motivo.

El error es: "app.js:6200 Conexión WebSocket a 'ws://localhost:8080/socket' falló: conexión cerrada inaccesible"

Servidor

 $server = new \Ratchet\App('localhost', 8080); $server->route('/socket', new WebSocketHandler, array('*')); $server->run();

WebSocketHandler es una implementación básica de WampServerInterface y solo incluye los métodos abstractos sin ningún cambio.

En el lado del cliente, estoy haciendo lo siguiente para probar una conexión a través de autobahn-js:

 var connection = new Autobahn.Connection({ transports: [{ type: 'websocket', port: 8080, host: 'localhost', url: 'ws://localhost:8080/socket' }], realm: 'realm1' }); connection.onopen = function(session) { app.content = app.content + `connected!` }; connection.onclose = function(reason, details) { app.content = app.content + `onclose!` } connection.open();

Hice algo mal en esta implementación, pero no puedo resolverlo. Intenté evitar el ->route y usar el siguiente enfoque estándar:

 $server = IoServer::factory( new HttpServer( new WsServer( new WampServer( new WebSocketHandler() ) ) ), 8080 );

Pero, no funcionó.

Cualquier ayuda es muy apreciada.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Necesita Autobahn.js 0.8.2 para conectarlo a Ratchet (WAMP v1) y es una implementación bastante antigua y también ab 0.8.2 es extremadamente antiguo.

Debe navegar su trabajo a Thruway. Traté de hacerlo, pero no pude encontrar ninguna implementación personalizada de Thruway RatcherRouter (onMessage, onOpen, etc.), por lo tanto, decidí hacer mi propia (bastante mala) implementación de Ratchet.

TL; DR: Cambiar a Thruway.

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!