feat(protocol): allow override of dial func
This commit is contained in:
@ -18,6 +18,8 @@ type Operations struct {
|
||||
client *socketio.Client
|
||||
mutex sync.RWMutex
|
||||
logger logger.Logger
|
||||
|
||||
dial protocol.DialFunc
|
||||
}
|
||||
|
||||
// Close implements protocol.Operations.
|
||||
@ -49,12 +51,12 @@ func (o *Operations) Connect(ctx context.Context) error {
|
||||
o.client.Close()
|
||||
}
|
||||
|
||||
endpoint, err := socketio.EndpointFromHAddr(o.addr)
|
||||
endpoint, err := socketio.EndpointFromAddr(o.addr)
|
||||
if err != nil {
|
||||
return errors.WithStack(err)
|
||||
}
|
||||
|
||||
client := socketio.NewClient(endpoint)
|
||||
client := socketio.NewClient(endpoint, socketio.WithDialFunc(socketio.DialFunc(o.dial)))
|
||||
|
||||
o.logger.Debug("connecting", logger.Attr("endpoint", endpoint))
|
||||
|
||||
|
Reference in New Issue
Block a user