Connect to third party websocket service with SignalR

stef-k 21 Reputation points
2021-01-03T17:58:53.153+00:00

Can I use the SignalR library to connect to a third party websocket service to pull data?

I plan to use it in both a command line and an ASP.NET core application if that matters.

Is there a code example available? All examples are about ASP.NET projects using SignalR at server side where clients can connect to.

I'm interested to use it as a client from a C# project.

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,415 questions
ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,207 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,306 questions
0 comments No comments
{count} votes

Accepted answer
  1. Fei Han - MSFT 306 Reputation points Microsoft Vendor
    2021-01-04T07:17:04.81+00:00

    Hi @stef-k , if you check the official doc with example about using ASP.NET Core SignalR .NET client library, you can find that it enables us to connect to a SignalR hub by configuring the HubConnection to use HTTP-based transports to connect to the specified URL.

    connect to a third party websocket service to pull data

    If you'd like to implement a client to connect to a WebSocket endpoint, you can try to use the ClientWebSocket api.

    https://github.com/dotnet/aspnetcore/blob/b795ac3546eb3e2f47a01a64feb3020794ca33bb/src/SignalR/samples/WebSocketSample/Program.cs


    If the answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    With Regards,
    Fei Han

    1 person found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Duane Arnold 3,216 Reputation points
    2021-01-04T07:00:33.897+00:00

    ASP.NET SignalR is Web server-side technology, a service, and it is not client-side technology.

    But you can check it out in the SignalR forum in ASP.NET forums.

    0 comments No comments