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.
-
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
Stream
object. I want my ASP.NET app to respond to HTTP requests sent over thatStream
instead of the usual TCP.And on the client side I need to configure
HttpClient
so 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
HttpClient
as 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