websocket: version != 13
Closed this issue · 2 comments
I tried running the chat app of chapter 1 before getting into the: Getting more out of templates
section and I've encountered a similar problem to the one in the issue #24. The error I get is: websocket: version != 13
. I try manually adding the header Sec-Websocket-Version
and then I of course get the websocket: could not find connection header with token 'upgrade'
error. When I inspect the request that the ServeHTTP
method gets I see that there is no header indicating that a websocket handshake is(or should be) in progress. I leave the request that the ServeHTTP
gets:
With chrome
&{GET /room HTTP/1.1 1 1 map[User-Agent:[Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.116 Safari/537.36]
Accept-Encoding:[gzip, deflate, sdch]
Accept-Language:[es-ES,es;q=0.8,en;q=0.6,gl;q=0.4]
Cookie:[member_id=MQ%3D%3D--07784fc636c4d418d9b56b62de61cc9b219dbeaa; educator_locale=ru; _ga=GA1.1.361596526.1456451039]
Connection:[keep-alive]
Accept:[text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8]
Upgrade-Insecure-Requests:[1]] 0x640190 0 [] false localhost:30 map[] map[] <nil> map[] [::1]:50270 /room <nil> <nil>}
Does the Upgrade-Insecure-Requests
have anything to do with this problem? Because I also tried this with safari and firefox and the request do not have that header. But I still get the same error.
Safari:
&{GET /room HTTP/1.1 1 1 map[User-Agent:[Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_3) AppleWebKit/601.4.4 (KHTML, like Gecko) Version/9.0.3 Safari/601.4.4]
Accept:[text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8]
Accept-Language:[en-us]
Connection:[keep-alive]
Accept-Encoding:[gzip, deflate]] 0x640190 0 [] false localhost:8080 map[] map[] <nil> map[] [::1]:50378 /room <nil> <nil>}
Firefox:
&{GET /room HTTP/1.1 1 1 map[User-Agent:[Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:46.0) Gecko/20100101 Firefox/46.0]
Accept:[text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8]
Accept-Language:[en-US,en;q=0.5]
Accept-Encoding:[gzip, deflate]
Connection:[keep-alive]] 0x640190 0 [] false localhost:8080 map[] map[] <nil> map[] [::1]:50429 /room <nil> <nil>}
Also, it seems that all Connection
headers indicate a keep-alive
conn instead of an Upgrade
It turned out to be a problem with the proxy I have setup. Sorry about the confusion, awesome stuff so far 👍