Replies: 2 comments
-
|
OK, I figured I can implement What remains unclear is the |
Beta Was this translation helpful? Give feedback.
-
|
It's your lucky day, I happen to have implemented this: Server: Client: There's some YARP goop in there but for HttpClient you can do: That connect callback allows you to return a custom stream. See https://learn.microsoft.com/en-us/dotnet/api/system.net.http.socketshttphandler.connectcallback?view=net-7.0 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
How do I configure my ASP.NET app to use a custom transport mechanism?
E.g. on the server side I have an event that fires whenever some client is connected and passes a
Streamobject. I want my ASP.NET app to respond to HTTP requests sent over thatStreaminstead of the usual TCP.And on the client side I need to configure
HttpClientso that it called my transport mechanism'sStream Connect(string host)method.The transport mechanism abstractions involved may vary, but ideally I want minimal modifications to the ASP.NET app and keep
HttpClientas the access abstraction. Ideally the client should be able to send multiple interleaved requests over the same connection.Beta Was this translation helpful? Give feedback.
All reactions