0
I am trying to connect a websocket with parameters in URL. Same url I can connect from python without any issues. But from c# I'm getting exception when I do the ConnectAsync Unable to connect to the remote server
Code Snippet:
System.Net.WebSockets.Managed.ClientWebSocket _clientWebSocket;
_clientWebSocket = new System.Net.WebSockets.Managed.ClientWebSocket();
var marketdatawithT = "wss://abc.com/api/st/co/?
token=c2c49d92asf9b44925ec5f43b0ff5d9fdaeahdfjsbf2";
await _clientWebSocket.ConnectAsync(new Uri(marketdatawithT ), CancellationToken.None);
Any help why I'm not able to connect a WebSocketwith url as a parameter from c#? I can connect to endpoint which does not have URL without any issues. I have also tried to encode the url in token like below:
var marketdatawithT = "wss://abc.com/api/st/co/?token=" +
System.Net.WebUtility.UrlEncode("c2c49d92asf9b44925ec5f43b0ff5d9fdaeahdfjsbf2");
But still see the same issue. Any help will be highly appreciated.