Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Epic] SignalR should have a C++ client #5301

Closed
5 of 8 tasks
BrennanConroy opened this issue May 25, 2018 · 31 comments
Closed
5 of 8 tasks

[Epic] SignalR should have a C++ client #5301

BrennanConroy opened this issue May 25, 2018 · 31 comments
Assignees
Labels
affected-few This issue impacts only small number of customers area-signalr Includes: SignalR clients and servers enhancement This issue represents an ask for new feature or an enhancement to an existing one Epic Groups multiple user stories. Can be grouped under a theme. feature-client-c++ Related to the SignalR C++ client severity-major This label is used by an internal tool
Milestone

Comments

@BrennanConroy
Copy link
Member

BrennanConroy commented May 25, 2018

@muratg
Copy link
Contributor

muratg commented May 29, 2018

cc @anurse

@BrennanConroy
Copy link
Member Author

BrennanConroy commented Jun 11, 2018

List of possible work items, issues can be created from these once we decide which ones we will be implementing and importance:

  • Review public API
  • Add SignalR Service support, mainly add redirect and auth from handshake response
  • Review configuration options
  • Add new tests (probably mostly around protocol)
  • Remove unrelated tests
  • Remove remnants of classic ASP.NET protocol
  • Add different protocol support (json is fairly hard-coded currently)
  • CI build integration
  • Cross-platform builds?
  • Client-Side pinging
  • Add Streaming support
  • Add MessagePack
  • Other transports, LongPolling and ServerSentEvents

@analogrelay
Copy link
Contributor

Let's do an API review next week. @BrennanConroy can you schedule something?

@alexsandro-xpt
Copy link

I missing this ❤️ thanks all!

@BrennanConroy BrennanConroy changed the title Plan C++ Client Work C++ Client Work Jul 5, 2018
@BrennanConroy
Copy link
Member Author

That is what the second item on the list is

Add SignalR Service support, mainly add redirect and auth from handshake response

@BrennanConroy
Copy link
Member Author

access_token=<my azure access key> This is gotten by making a negotiate request to your app. I'm guessing you're using the wrong key here.

Manually make a request to your server to the /negotiate endpoint, get the response which should be {"url":"...","accessToken":"token"} and then create your hub connection using that info.

@BrennanConroy
Copy link
Member Author

https://some-random-signalr.service.signalr.net is not your endpoint base. The server that you host that calls AddAzureSignalR is your endpoint. So you need to make a POST to your server at [endpoint]/negotiate which is where you'll get the redirect negotiate response.

@analogrelay
Copy link
Contributor

It's important to note how the SignalR Service works. It's designed to be completely transparent to the client configuration:

  1. The first thing the client does is connect directly to your application. This is so that all your authentication logic can run. So if your app is running on http://mysite.com and the below logic in it's Startup.Configure, then your initial endpoint base is http://mysite.com/myhub
app.UseAzureSignalR(routes =>
{
    routes.MapHub<MyHub>("/myhub");
}
  1. The Azure SignalR SDK (which you must be using on the server) handles this request (this is what app.UseAzureSignalR does in your server app), and gets an special single-use access token from the service. Your app (via the Azure SignalR SDK) sends the URL for the Service endpoint and that access token back as a "redirect response" (that's number 2 in the section on negotiate in the spec)

  2. The client then takes the URL provided in the response (which will be based on https://some-random-signalr.service.signalr.net) and uses that as the new endpoint base. It also uses the access token and puts it in the Authorization HTTP header as a Bearer token. Then it does the normal SignalR negotiate handshake with the new endpoint base.

A brief diagram of these three steps:

image

@analogrelay
Copy link
Contributor

I don't know what might be going wrong there. It's a little strange that you're specifying half the querystring (?url=chat&asrs.op=%2Fchat) in the URL and another half (access_token=[...]) in the querystring. What is the URL that the C++ client actually ends up requesting?

@BrennanConroy
Copy link
Member Author

BrennanConroy commented Sep 13, 2018

I started work on making the client work with the service a while ago. If you're comfortable changing the signalr client source code you can copy what I did here: aspnet/SignalR@8b09728

@analogrelay
Copy link
Contributor

I'm afraid we don't have much in the way of resources to work on C++ right now. As @BrennanConroy mentioned we have some prototype code, but we're busy with other stuff right now and not really able to put together a complete example.

If there is a way to monitor outgoing requests from VS that would help.

You can debug through the SignalR client code, right?

@bradygaster
Copy link
Member

Not saying we're officially committed to the C++ client story but we are considering it for the 3.0 time frame. As well as other potential new clients.

@aspnet-hello aspnet-hello transferred this issue from aspnet/SignalR Dec 17, 2018
@aspnet-hello aspnet-hello added this to the 3.0.0 milestone Dec 17, 2018
@aspnet-hello aspnet-hello added area-signalr Includes: SignalR clients and servers feature-client-c++ Related to the SignalR C++ client cost: XL labels Dec 17, 2018
@BrennanConroy BrennanConroy modified the milestones: 3.0.0, 3.0.0-preview3 Jan 15, 2019
@BrennanConroy
Copy link
Member Author

Our priorities have changed and I can't guarantee that this will ship in the 3.0 release.

https://github.com/aspnet/SignalR-Client-Cpp is where we will be doing work on the C++ client. Feel free to test it out and file issues in this repo.

@proga7med
Copy link

  • Does signalr support a hub proxy? I can't see the hub proxy class

@analogrelay
Copy link
Contributor

No, the Hub Proxy mechanism is no longer present in the SignalR client. Instead you call .InvokeAsync("NameOfMethod", arg1, arg2) on the HubConnection. By the way, this issue is tracking our work on a C++ client, I'd suggest posting a separate issue if you have a general SignalR question, or asking on Stack Overflow.

@ghost
Copy link

ghost commented Jul 27, 2020

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

@BrennanConroy BrennanConroy added affected-few This issue impacts only small number of customers enhancement This issue represents an ask for new feature or an enhancement to an existing one severity-major This label is used by an internal tool labels Oct 21, 2020 — with ASP.NET Core Issue Ranking
@BrennanConroy BrennanConroy self-assigned this Jan 20, 2021
@BrennanConroy BrennanConroy modified the milestones: Backlog, 6.0.0 Jan 20, 2021
@BrennanConroy BrennanConroy modified the milestones: 6.0.0, .NET 7 Planning Oct 4, 2021
@BrennanConroy BrennanConroy modified the milestones: .NET 7 Planning, 7.0-rc2 Jul 7, 2022
@BrennanConroy BrennanConroy modified the milestones: 7.0-rc2, 7.0.0 Sep 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affected-few This issue impacts only small number of customers area-signalr Includes: SignalR clients and servers enhancement This issue represents an ask for new feature or an enhancement to an existing one Epic Groups multiple user stories. Can be grouped under a theme. feature-client-c++ Related to the SignalR C++ client severity-major This label is used by an internal tool
Projects
None yet
Development

No branches or pull requests