Marfusios / websocket-client

🔧 .NET/C# websocket client library
MIT License
682 stars 126 forks source link

Uris starting with ws or wss #36

Open ZigmundL opened 4 years ago

ZigmundL commented 4 years ago

Hello. Bittrex exchange uses this address for websocket api: "https://socket.bittrex.com/signalr".

websocket-client cannot connect with https, throwing exception that Uris must start with "ws://" of "wss://". If I replace https with wss then I get "Unable connect to thre remote server" exception.

https://bittrex.github.io/api/v1-1

ZigmundL commented 4 years ago

Seems like it is microsofts exception. Here is workaround wss://104.17.152.108/signalr But there's some certificate problems and it cannot connect anyway but I get another exceptions.

Marfusios commented 4 years ago

Hello, SignalR is a wrapper/extension over raw websocket protocol. So you have to study SignalR documentation or even source code, there will be certainly some way to make it work with raw websocket client via wss/ws interface. This seems relevant: https://github.com/aspnet/AspNetCore/issues/10468

But if you don't need anything special, use SignalR client, it will save you ton of time. https://docs.microsoft.com/en-us/aspnet/core/signalr/dotnet-client?view=aspnetcore-3.1&tabs=visual-studio