diff --git a/client.go b/client.go index f5e02eb..1885c0e 100644 --- a/client.go +++ b/client.go @@ -6,9 +6,9 @@ import ( ) type options struct { - inExtension message.Extension - outExtension message.Extension - transport transport.Transport + inExt message.Extension + outExt message.Extension + transport transport.Transport } var defaultOpts = options{ @@ -36,6 +36,16 @@ func NewClient(url string, opts ...Option) (*Client, error) { for _, opt := range opts { opt(&c.opts) } + tops := &transport.Options{ + Url: url, + InExt: c.opts.inExt, + OutExt: c.opts.outExt, + } + + err := c.opts.transport.Init(tops) + if err != nil { + return nil, err + } return &c, nil } diff --git a/transport/transport.go b/transport/transport.go index 80fcd8a..c291c99 100644 --- a/transport/transport.go +++ b/transport/transport.go @@ -7,7 +7,7 @@ import "github.com/thesyncim/faye/message" type Options struct { Url string InExt message.Extension - outExt message.Extension + OutExt message.Extension //todo dial timeout //todo read/write deadline }