I can't start connection with WebSockets in EC2

Server Fault Asked by Paula Silva on December 21, 2020

I really need help with websockets, recently I used SSL(Let’s Encrypt) in my website that is in ec2, and I used route 53 for routing, and the website works perfectly with SSL and my DNS, but I can’t start connection with WebSockets and HTTPS, it only works with HTTP, using the port 8080, when I try to start connection with HTTPS under port 8443, Google console says:

WebSocket connection to "mysite" failed: WebSocket opening handshake
timed out

I really don’t know what to do anymore, in my point of view everything is okay with the part of coding but it really looks like a problem involving Apache and SSL, please help me, I’m with this problem there are 2 weeks and I don’t know what to do


Ports   Protocol    Source  SecurityGroup
80  tcp, ::/0 ✔
8080    tcp, ::/0 ✔
4433    tcp, ::/0 ✔
22  tcp   ✔
8443    tcp, ::/0 ✔
3000    tcp   ✔
443 tcp, ::/0 ✔


use RatchetServerIoServer;
use RatchetHttpHttpServer;
use RatchetWebSocketWsServer;
use AnneSocketChat;

    require dirname(__DIR__) . '/vendor/autoload.php';

    $server = IoServer::factory(
        new HttpServer(
            new WsServer(
                new Chat()



var conn = new WebSocket('wss://'); //Using port 8433, it doesn't works as any port, I already tried a lot of ports


Listen 80

    <VirtualHost *:80>
        DocumentRoot "/var/www/html"
        ServerName ""
        ServerAlias ""
    RewriteEngine on
    RewriteCond %{SERVER_NAME} [OR]
    RewriteCond %{SERVER_NAME}
    RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
    ProxyPreserveHost On
    ProxyPass /chat.php/ ws://
    ProxyPassReverse /chat.php/ ws://

Add your own answers!

Related Questions

Enabling jumbo frame on tg3

0  Asked on December 15, 2020 by gli-illuminati


Postfix does not retry after 451 error / greylisting

2  Asked on December 14, 2020 by assylias


OpenVPN over dynamic IPv6

1  Asked on December 14, 2020 by hellstorm


autossh does not kill ssh when link down

1  Asked on December 13, 2020


Is it safe to write batch files with Unix line endings?

4  Asked on December 13, 2020 by cmcginty


On demand new IPv6 using privacy extension?

1  Asked on December 12, 2020 by wannabecoder


nginx, gitlab, subdomain

1  Asked on December 10, 2020 by emidee


Move Access 2016 Database to Azure?

0  Asked on December 9, 2020 by user601108


Ask a Question

Get help from others!

© 2022 All rights reserved. Sites we Love: PCI Database, MenuIva, UKBizDB, Menu Kuliner, Sharing RPP, SolveDir