Skip to content

Instantly share code, notes, and snippets.

@toddsby
Created February 10, 2015 16:02
Show Gist options
  • Save toddsby/199d0dbec382ebec87cf to your computer and use it in GitHub Desktop.
Save toddsby/199d0dbec382ebec87cf to your computer and use it in GitHub Desktop.
socket.io and apache reverse proxy fix
I modified the source code of socket.io-client/socket.io.js 1.0.6
line 3387:
return schema + '://' + this.hostname + port + this.path + query;
Changed to:
return schema + '://' + this.hostname + port + this.path + 'ws/' + query;
And my ProxyPass config:
ProxyPass /socket.io/ws/ ws://localhost:60002/socket.io/
ProxyPassReverse /socket.io/ws/ ws://localhost:60002/socket.io/
ProxyPass /socket.io/ http://localhost:60002/socket.io/
ProxyPassReverse /socket.io/ http://localhost:60002/socket.io/
It works well.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment