title: Crossbar caddy reverse proxy
body: <p>How could I set a reverse proxy with caddy that speak with a crossbar router?</p>
  
  <p>I have a docker with a crossbar router that listen on localhost 8080, and I use caddy as a reverse proxy.</p>
  
  <p>Below the Caddyfile:</p>
  
  <pre><code>`0.0.0.0:80
   proxy /ws localhost:8080{
       proxy_header Connection {&gt;Connection}
       proxy_heade Upgrade {&gt;Upgrade}
   }
   header /ws {
       Upgrade "WebSoket"
       Connection "Upgrade"
   }`
  </code></pre>
  
  <p>'tcpflow 8080' return nothing when I try to connect.</p>
  
  <p>Below the header from chrome:</p>
  
  <p>RESPONSE</p>
  
  <pre><code>HTTP/1.1 101 Switching Protocols
  Connection: Upgrade
  Sec-Websocket-Accept: r/PdCQJibmcb5XrfVbnSXJMuf9g=
  Sec-Websocket-Protocol: wamp.2.json
  Server: Caddy
  Server: Crossbar/0.11.1
  Upgrade: WebSocket
  X-Powered-By: AutobahnPython/0.10.9
  Date: Tue, 09 Feb 2016 14:12:04 GMT
  </code></pre>
  
  <p>REQUEST</p>
  
  <pre><code>GET ws://78.46.244.23/ws HTTP/1.1
  Host: 78.46.244.23
  Connection: Upgrade
  Pragma: no-cache
  Cache-Control: no-cache
  Upgrade: websocket
  Origin: chrome://newtab
  Sec-WebSocket-Version: 13
  User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTM 
     like Gecko) Chrome/48.0.2564.103 Safari/537.36
  Accept-Encoding: gzip, deflate, sdch
  Accept-Language: it-IT,it;q=0.8,en-US;q=0.6,en;q=0.4
  Sec-WebSocket-Key: OaEUxWnqjZWyfLypeYxeXw==
  Sec-WebSocket-Extensions: permessage-deflate; client_max_window_bits
  Sec-WebSocket-Protocol: wamp.2.json
  </code></pre>
  
  <p>Below the frame:</p>
  
  <pre><code>[1,"realm1",{"roles":{"caller":{"features":{"caller_identification":true,"progressive_call_results":true}},"callee":{"features":{"progressive_call_results":true}},"publisher":{"features":{"subscriber_blackwhite_listing":true,"publisher_exclusion":true,"publisher_identification":true}},"subscriber":{"features":{"publisher_identification":true}}}}]
  </code></pre>
  
  <p>And the console error:</p>
  
  <pre><code>WebSocket connection to 'ws://78.46.244.23/ws' failed: Invalid frame header
  </code></pre>