more transport options
This commit is contained in:
parent
8adb569f0f
commit
27fdd47d29
@ -3,16 +3,20 @@ package transport
|
||||
import (
|
||||
"github.com/thesyncim/faye/message"
|
||||
"github.com/thesyncim/faye/subscription"
|
||||
"net/http"
|
||||
"time"
|
||||
)
|
||||
|
||||
//Options represents the connection options to be used by a transport
|
||||
type Options struct {
|
||||
RetryInterval time.Duration
|
||||
|
||||
Extensions message.Extensions
|
||||
//todo dial timeout
|
||||
//todo read/write deadline
|
||||
|
||||
Headers http.Header
|
||||
|
||||
RetryInterval time.Duration
|
||||
DialDeadline time.Duration
|
||||
ReadDeadline time.Duration
|
||||
WriteDeadline time.Duration
|
||||
}
|
||||
|
||||
//Transport represents the transport to be used to comunicate with the faye server
|
||||
|
@ -56,7 +56,7 @@ func (w *Websocket) Init(endpoint string, options *transport.Options) error {
|
||||
w.subs2 = map[string][]*subscription.Subscription{}
|
||||
w.onPublishResponse = map[string]func(message *message.Message){}
|
||||
w.stopCh = make(chan error)
|
||||
w.conn, _, err = websocket.DefaultDialer.Dial(endpoint, nil)
|
||||
w.conn, _, err = websocket.DefaultDialer.Dial(endpoint, options.Headers)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user