Allow request headers to be included in initial connection to server

This commit is contained in:
Daniel Cormier 2016-11-18 14:38:22 -05:00
parent 098f1cc65e
commit 9010d067c5
1 changed files with 3 additions and 1 deletions

View File

@ -88,11 +88,13 @@ type WebsocketTransport struct {
SendTimeout time.Duration
BufferSize int
RequestHeader http.Header
}
func (wst *WebsocketTransport) Connect(url string) (conn Connection, err error) {
dialer := websocket.Dialer{}
socket, _, err := dialer.Dial(url, nil)
socket, _, err := dialer.Dial(url, wst.RequestHeader)
if err != nil {
return nil, err
}