Commit Graph

16 Commits

Author SHA1 Message Date
Gary Burd 2d1e4548da Simplify dial TLS test
There's no need to fake the connection to example.com because 127.0.0.1
is a host in the net/http/httptest certificate.
2016-09-12 08:30:41 -07:00
Seiichi KONDO 360dfe00ec Support proxy authorization for websocket client 2016-02-17 21:46:45 +09:00
Gary Burd 9727ab9cda Test URL path and query 2015-12-15 20:25:50 -08:00
Gary Burd 567453a710 Require GET in Upgrader.Upgrade.
Return error if the request method is not GET.

Remove all request method tests from the examples.
2015-11-02 09:08:11 -08:00
Gary Burd a4e0143e1f Do not allow duplicate headers in handshake 2015-11-02 08:39:02 -08:00
Mark Wolfe 70eca1b8e7 Add Proxy support for websocket clients.
- Uses `http.ProxyFromEnvironment` for configuration in line with the
golang standard library.
2015-10-23 09:28:47 +11:00
Gary Burd 5ed2f4547d Refactor client handshake
- To take advantage of the Host header cleanup in the net/http
  Request.Write method, use a net/http Request to write the handshake to
  the wire.
- Move code from the deprecated NewClientConn function to Dialer.Dial.
  This change makes it easier to add proxy support to Dialer.Dial. Add
  comment noting that NewClientConn is deprecated.
- Update the code so that parseURL can be replaced with net/url Parse.
  We need to wait until we can require 1.5 before making the swap.
2015-10-21 10:08:33 -07:00
Peter Waller 6fd0f867fe Allow separate specification of http/dial Hosts
Enable the Host: header to be customized in a Dialer.Dial call.

This is needed to implement websocket proxies.
2015-05-10 11:51:08 +01:00
Gary Burd b2fa8f6d58 Return response body on bad handshake.
The Dialer.Dial method returns an *http.Response on a bad handshake.
This CL updates the Dial method to include up to 1024 bytes of the
response body in the returned *http.Response. Applications may find the
response body helpful when debugging bad handshakes.

Fixes issue #62.
2015-05-08 15:39:37 -07:00
Gary Burd 411599d366 Cleanup client/server tests. 2014-07-05 08:49:11 -07:00
Gary Burd 0f32413e5e Relax default origin test.
Update the default origin test to treat no origin specified as OK. If
the client can create a request without the origin set, then the client
can also create a request with an arbitrary origin.
2014-06-30 14:57:20 -07:00
Gary Burd bbe4cde693 Use Upgrader in client/server test. 2014-04-20 12:08:24 -07:00
Gary Burd 15aed3b4a4 Relicense to the Gorilla WebSocket Authors. 2014-04-18 14:25:11 -07:00
Gary Burd b118f62ec0 Add subprotocol negotiation to Dialer. 2013-12-14 08:06:24 -08:00
Gary Burd 87accaef66 Add Dialer. 2013-12-14 08:06:24 -08:00
Gary Burd 273ecadfca Initial commit 2013-10-16 16:30:59 -07:00