Closed jagoPG closed 7 months ago
There is another solution for using a WebSocket without negotiation. Just use the WithConnection
option and pass a *webSocketConnection
. To allow this, you just need to add something like this:
func NewWebSocketConnection(ctx context.Context, connectionID string, opts websocket.DialOptions) (Connection, error) {
ws, _, err := websocket.Dial(ctx, reqURL.String(), opts)
if err != nil {
return nil, err
}
return newWebSocketConnection(ctx, connectionId, ws), nil
}
I would prefer that kind of solution, as there are no changes to the common code are necessary.
Thanks, this worked for me. I changed the func
signature so the internal dependencies are not exposed.
Adds support for skipVerification additional option