Aspire does not proxy Quic protocol
- Dominant language
- C#
- Stars
- 6.3k
- Forks
- 991
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 196
Description
### Is there an existing issue for this?
- [x] I have searched the existing issues
### Describe the bug
Hello,
Aspire does not proxy the Quic protocol when randomizing port on asp.net project endpoints.
Here the setup:
**AppHost**
```
// both simple asp.net project
var projectA = builder.AddProject("project-a");
var projectB = builder.AddProject("project-a")
.WithReference(projectA);
```
ProjectA include:
```
builder.WebHost.UseQuic();
```
**lauchsettings.json of project-a**
```
"applicationUrl": "https://localhost:7299;http://localhost:5114"
```
**When starting project-a get the following environment variable (randomized ports):**
```
ASPNETCORE_URLS = https://localhost:51753;http://localhost:51754
```
And the following logs:
```
QUIC listener starting with configured endpoint 127.0.0.1:51753.
Now listening on: https://localhost:51753
Now listening on: http://localhost:51754
```
**When starting project-b get the following environment variable:**
```
services__project-a__https__0 = https://localhost:7299
```
**When project-b calls https://localhost:7299 via Quic (gRPC + HTTP3), I get the following error:**
```
System.Net.Http.HttpRequestException: Requesting HTTP version 3.0 with version policy RequestVersionOrHigher while unable to establish HTTP/3 connection.
---> System.Net.Http.HttpRequestException: Une opération a été tentée sur un hôte impossible à atteindre. (localhost:7299)
```
**A direct call using the random port works:**
```
curl.exe -k -v -i --http3-only -X POST https://localhost:51753/NodeManagement.NodeLifetime/Register
< HTTP/3 415
< grpc-status: 13
< grpc-message: Content-Type is missing from the request.
```
**Workaround:**
If I disable the proxy of the https endpoint, it works but it's not ideal.
```
projectA.WithEndpoint("https", endpoint => endpoint.IsProxied = false);
```
### Expected Behavior
_No response_
### Steps To Reproduce
_No response_
### Exceptions (if any)
_No response_
### Aspire doctor output
_No response_
### Anything else?
_No response_
Contributor guide
Research direction
Start with the AppHost endpoint wiring and launchsettings.json behavior described in the report, then trace how Aspire creates proxied HTTPS service URLs when ASPNETCORE_URLS contains randomized ports. Reproduce the project-a/project-b setup with UseQuic and HTTP/3, and verify that the proxied endpoint reaches the randomized QUIC listener while preserving normal proxy behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, grpc
- Domain
- backend-api-design, networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100