dotnet / dotnet/aspnetcore

MapHub extension with custom hub hame

Open
#63,791 0 comments 0 reactions 0 assignees View on GitHub
area-signalr
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 10h
Merged PRs (30d)
281

Description

### Is there an existing issue for this?

- [x] I have searched the existing issues

### Is your feature request related to a problem? Please describe the problem.

I am trying to set up local development using an Azure Signalr instance in a way where developer APIs that handle incoming SignalR requests don't interfere with each other. I had the same issue with Azure Web Pubsub and it was addressed there with this PR (in response to a feature request): https://github.com/Azure/azure-sdk-for-net/pull/47022

I tried using unique paths per machine when registering the hub (e.g. "/hub1", "/hub2"), but there was still interference.

### Describe the solution you'd like

Adding extension method for specifying custom hub name:

```
public void Configure(IApplicationBuilder app)
{
app.UseEndpoints(endpoint =>
{
endpoint.MapHub("/sampleHubPath", "customHubName");
});
}
```

### Additional context

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the existing MapHub extension methods and the linked Azure Web PubSub pull request, then trace how the hub path and name are registered. Done means a custom hub name can be supplied alongside the path as shown, with the behavior covered by the relevant existing tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, csharp
Domain
api, backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.