philippseith / signalr

SignalR server and client in go
MIT License
131 stars 39 forks source link

feature: adds configuration parameter to allow skipVerification additional option #195

Closed jagoPG closed 7 months ago

jagoPG commented 7 months ago

Adds support for skipVerification additional option

philippseith commented 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.

jagoPG commented 7 months ago

Thanks, this worked for me. I changed the func signature so the internal dependencies are not exposed.