GeniusesOfSymfony / WebSocketBundle

:part_alternation_mark: Websocket server for Symfony applications (powered by Ratchet), includes a Autobahn.JS based JavaScript client
MIT License
609 stars 140 forks source link

Error establishing connection in SSL #272

Closed igorjacon closed 6 years ago

igorjacon commented 6 years ago

Hi, I'm trying to configure websocket in SSL, I've followed the instructions here but I'm still getting the following error:

WebSocket connection to 'wss://enuovo.fail:8443/' failed: Error in connection establishment: net::ERR_CONNECTION_TIMED_OUT

Here is my stunnel configuration:

screen shot 2017-12-03 at 19 05 20

my websocket config:

gos_web_socket:
    server:
        port: %web_socket_server.port%
        host: %domain%.%ltd%
        router:
            resources:
                - "@EnuovoWebSocketBundle/Resources/config/routing.yml"
    client:
        firewall: ["super_admin", "admin", "shop"]
        session_handler: "@session.handler.pdo"
    pushers:
        wamp:
            host: %domain%.%ltd%
            port: %web_socket_server.port%

I then run my websocket server like so: php bin/console gos:websocket:server -a enuovo.fail -e=prod -n

18:49:16 INFO      [websocket] Starting web socket [] []
18:49:16 INFO      [websocket] Register periodic callback Gos\Bundle\WebSocketBundle\Periodic\PdoPeriodicPing, executed each 20 seconds [] []
18:49:16 INFO      [websocket] Launching Ratchet on enuovo.fail:8080 PID: 7181 [] []

So my websocket server is running on port 8080, which is the connect port specified in my stunnel config, and in my JS I connect to the websocket with the accept port:

var _WS_URI = "wss://{{ gos_web_socket_server_host }}:8443";
var messageWebSocket = WS.connect(_WS_URI);

Can someone tell me what I am doing wrong? Here is my stunnel log:

screen shot 2017-12-03 at 19 25 04

Everything seems to be running fine but I still get this connection error. :/

igorjacon commented 6 years ago

@CoalaJoe @AntoineTesson @ProPheT777 Can someone help me. what am I doing wrong? Thanks

CoalaJoe commented 6 years ago

What connection error do you get on the client side?

igorjacon commented 6 years ago
screen shot 2017-12-08 at 13 45 42

Thanks for your reply @CoalaJoe

alandwiprasetyo commented 6 years ago

this problem also happened to me

CoalaJoe commented 6 years ago
igorjacon commented 6 years ago

Thank you @CoalaJoe

Firewall blocking port 8443. Works great now. Thanks again 👍

CoalaJoe commented 6 years ago

@igorjacon Great to hear that. Have fun using this bundle.

Can you please close this issue afterwards?