garyburd/go-websocket — pull request #12 by sqs (2013-09-17 15:34:10+00:00)
Title: Expose *http.Response if NewClient handshake fails

This PR makes `NewClient` return the `*http.Response` if the handshake fails, so that clients can handle servers that require authentication or provide alternate representations of content.

This satisfies [RFC 6455](http://tools.ietf.org/html/rfc6455#section-4):

```
...

The client MUST validate the server's response as follows:

1. If the status code received from the server is not 101, the
client handles the response per HTTP [RFC2616] procedures. In
particular, the client might perform authentication if it
receives a 401 status code; the server might redirect the client
using a 3xx status code (but clients are not required to follow
them), etc. Otherwise, proceed as follows.

...
```