How to send Parameter/Query in HubConnection SignalR Core

后端 未结 1 1077
陌清茗
陌清茗 2021-02-05 08:06

I\'m trying to add parameter into connection to signalr.

I\'m using Builder to create my Client connection and start it:

var connection = new HubConnecti         


        
1条回答
  •  时光取名叫无心
    2021-02-05 08:35

    I have found how to do this after much research:

    On my build i just send the token from url connection. Like this:

    var connection = new HubConnectionBuilder()
            .WithUrl($"http://10.0.2.162:5002/connection?token={token}")
            .WithConsoleLogger()
            .WithMessagePackProtocol()
            .WithTransport(TransportType.WebSockets)
            .Build();
    

    0 讨论(0)
提交回复
热议问题