Merge pull request #11 from dcormier/master
Allow request headers to be included in initial connection to server
This commit is contained in:
commit
fe537904e1
|
@ -88,11 +88,13 @@ type WebsocketTransport struct {
|
||||||
SendTimeout time.Duration
|
SendTimeout time.Duration
|
||||||
|
|
||||||
BufferSize int
|
BufferSize int
|
||||||
|
|
||||||
|
RequestHeader http.Header
|
||||||
}
|
}
|
||||||
|
|
||||||
func (wst *WebsocketTransport) Connect(url string) (conn Connection, err error) {
|
func (wst *WebsocketTransport) Connect(url string) (conn Connection, err error) {
|
||||||
dialer := websocket.Dialer{}
|
dialer := websocket.Dialer{}
|
||||||
socket, _, err := dialer.Dial(url, nil)
|
socket, _, err := dialer.Dial(url, wst.RequestHeader)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue