Comments (4)
We have a general issue to track traffic mirroring (#105), but that is mainly about duplicating outgoing requests and potentially performing validation on different responses. The forwarded response still comes from a single destination.
Splitting requests and then merging responses like in your scenario is bound to involve custom logic to specify how requests are generated, how merging should work, what policies to use for some failed/delayed responses, etc. I'm not aware of an established practice that one would follow here.
Given the highly custom nature of such scenarios (and limited examples of different users doing so), I don't think we should be trying to design an abstraction here, as it's not clear what benefits it would provide.
Closing this issue as wont-fix, but we can of course revisit the decision in the future if there's more user demand and we believe we can provide value.
from reverse-proxy.
Absolutely agree with the reasoning. Thanks for taking the time to reply
from reverse-proxy.
For a scatter scenario, would you want to send anything other than GET requests?
If you want to create new scatter requests, all that is involved is along the lines of
async Task<HttpRequestMessage> CreateScatterRequestAsync(HttpContext context, string destinationPrefix, CancellationToken cancellationToken = default)
{
if (context.Request.Method != HttpMethods.Get || context.WebSockets.IsWebSocketRequest)
{
throw new NotSupportedException("...");
}
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
Version = HttpVersion.Version20,
VersionPolicy = HttpVersionPolicy.RequestVersionOrLower
};
await ScatterTransformer.Instance.TransformRequestAsync(context, request, destinationPrefix, cancellationToken);
// If you're not setting it in your transformer already
request.RequestUri ??= RequestUtilities.MakeDestinationAddress(destinationPrefix, context.Request.Path, context.Request.QueryString);
return request;
}
Most of the YARP logic around creating requests is around handling things like WebSocket version upgrades/downgrades and dealing with a custom HttpContent for POST requests.
In practice the above example is just setting the Method & Version, then calling the transformer. I'm not sure that is all that helpful / generic enough to have in YARP.
from reverse-proxy.
Thanks for following up! Yes it would be Get only.
Yeah this code would work. We could then simply pass the request message to the HttpMessageInvoker.
I figured I raise it here since you might be want to consider a scatter gather like abstraction similar to the forwarder interface
from reverse-proxy.
Related Issues (20)
- Reverse Proxy : does not forward when the request is coming from Azure APIM HOT 3
- How can Yet ReverseProxy implement HTTP proxy functionality like Fiddler (in https)? HOT 3
- YARP doesnt work on opening WebSockets towards .net UseProxyToSpaDevelopmentServer when the spa has live-reload enabled HOT 5
- Logging response body size HOT 12
- make public docker image available in dockerhub with some common configurations HOT 2
- YARP Reverse Proxy not working correctly with Blazor SSR Project in .net8 HOT 3
- Distributed Tracing docs should also include vanilla OTel instructions/sample HOT 2
- RequestHeaderXForwardedForTransform attaches IPv4-Mapped IPv6 Addresses to X-Forwarded-For in dual stack settings HOT 3
- When read de body return bad request HOT 2
- TaskCanceledException exceptions occurring randomly HOT 4
- YARP not able to detect UseRequestTimeouts middleware HOT 12
- Handling passive health check on multiple instances of Yarp
- How to configure HttpClient to use Default System Proxy HOT 1
- Got error when proxying POST request with form HOT 1
- Consider allowing query strings in health probes
- Encountering Looping Refresh Issue with Basic Authentication in YARP HOT 2
- Http.sys delegation should handle ERROR_OBJECT_NO_LONGER_EXISTS and try to re-attach to the queue
- YARP has a higher cpu usage than Nginx HOT 6
- AddPathRemovePrefix does not work HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from reverse-proxy.