Dimitar D.
Dimitar D.

Reputation: 205

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>

Upvotes: 5

Views: 3806

Answers (1)

dev0experiment
dev0experiment

Reputation: 520

Use Apache command:

a2enmod proxy_wstunnel
systemctl restart apache2

Upvotes: 2

Related Questions