RewriteEngine on
RewriteCond %{REQUEST_URI} ^/socket.io [NC]
RewriteCond %{QUERY_STRING} transport=websocket [NC]
RewriteRule /(.*) ws://localhost:3002/$1 [P,L]
ProxyPass /socket.io/ws/ ws://localhost:3002/socket.io/
ProxyPassReverse /socket.io/ws/ ws://localhost:3002/socket.io/
ProxyPass /socket.io/ http://localhost:3002/socket.io/
ProxyPassReverse /socket.io/ http://localhost:3002/socket.io/