Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WebSocket handshake: Unexpected response code: 400

Can't find out a solution. I'm not a lot into apache configs, but I currently need this to reroute to local server. I'm using solution for the reroute found somewhere in the internet. It worked. I have a connection, but I'm getting this error. WebSocket handshake: Unexpected response code: 400

Code:

<Location /tools/>
        RewriteEngine On

        RewriteCond %{REQUEST_URI}  ^/tools/socket.io            [NC]
        RewriteCond %{QUERY_STRING} transport=websocket          [NC]
        RewriteRule "^/tools/socket.io"           "ws://localhost:8080/socket.io/" [P,L]

        ProxyPass http://localhost:8080/
        ProxyPassReverse http://localhost:8080/
</Location>
like image 825
GhoSTBG Avatar asked Oct 29 '22 05:10

GhoSTBG


1 Answers

Use Apache command:

a2enmod proxy_wstunnel
systemctl restart apache2
like image 95
dev0experiment Avatar answered Jan 02 '23 19:01

dev0experiment