title: Using go-websocket behind Apache mod_proxy_wstunnel
body: <p><em>Note: Updated config and added trailing slash to websocket path. Still same problem</em></p>
  
  <p>Is it possible to use <a href="https://github.com/garyburd/go-websocket">go-websocket</a> behind a Apache reverse proxy with <a href="http://httpd.apache.org/docs/2.4/mod/mod_proxy_wstunnel.html">mod_proxy_wstunnel</a>?</p>
  
  <p>I tried and failed to get things working.</p>
  
  <p>I tried to use <a href="https://github.com/garyburd/go-websocket/tree/master/examples/chat">the Chat example</a> behind an Apache reverse proxy (with <a href="http://httpd.apache.org/docs/2.4/mod/mod_proxy_wstunnel.html">mod_proxy_wstunnel</a> enabled). And it doesn't work. The proxy is a success, while the websocket part does not work at all.</p>
  
  <p>My Apache config looks similar to this:</p>
  
  <pre><code>&lt;VirtualHost *:80&gt;
      DocumentRoot /var/www/foobar
      ServerName foobar.com
      ProxyPass / http://localhost:8080/
      ProxyPassReverse / http://localhost:8080/
      ProxyPass /ws/ ws://localhost:8080/ws/
      ProxyPassReverse /ws/ ws://localhost:8080/ws/
      ErrorLog logs/error_log-foobar
      CustomLog logs/access_log-foobar common
      LogLevel debug
  &lt;/VirtualHost&gt;
  </code></pre>
  
  <p>And of course I'm running the chat server on port 8080. I've tested it with SSH tunnel, and things work perfectly. Then I moved on to Apache.</p>
  
  <p>The first time I tried, the javascript console complains this:</p>
  
  <pre><code>NetworkError: 403 Forbidden - http://foobar.com/ws/
  </code></pre>
  
  <p>The request seems to be stucked at the origin check.
  Then I tried again after comment out the origin check, it get this:</p>
  
  <pre><code>NetworkError: 400 Bad Request - http://foobar.com/ws/
  </code></pre>
  
  <p>It seems the chat server do not get the upgrade request at all.</p>
  
  <p>How should I debug this?
  Where should I start looking?</p>