SlyMarbo / spdy

[deprecated] A full-featured SPDY library for the Go language.
BSD 2-Clause "Simplified" License
116 stars 13 forks source link

http.Get(api.linode.com) results in 'Unsupported negotiated protocol' error #74

Closed arashpayan closed 9 years ago

arashpayan commented 9 years ago

First off, thank you for the terrific library. I was able to enable SPDY support in my web service in just a few minutes with it. :smile:

I see inside client.go's init() http.DefaultClient to enable SPDY support, but when I make calls to api.linode.com I get Get https://api.linode.com: Error: Unsupported negotiated protocol "".

This gist contains sample code that reproduces the issue. https://gist.github.com/arashpayan/3927d6aae5e8e01aa43d

In the meantime, I just replace the http.DefaultClient at the beginning of my app with one without SPDY support.

SlyMarbo commented 9 years ago

This is a very odd issue. spdy detects which version has been negotiated by looking at the NPN protocol string, which normally takes the form spdy/x. In this instance, the negotiated protocol is the empty string, which tends to indicate HTTP. When I last checked, net/http treats this as normal and continues with the HTTP processing. Let me take another look at net/http and see whether something has changed.

SlyMarbo commented 9 years ago

Ah, I see what's happened; a silly oversight on my part. Fix on its way.

arashpayan commented 9 years ago

Brilliant. Thank you so much! :smiley:

SlyMarbo commented 9 years ago

No problem :)