add FastCgiHttpMessageHandler with basic tests
This allows to send normal HTTP requests using FastCGI protocol. Implementation is based on Caddy (https://github.com/caddyserver/caddy/tree/master/modules/caddyhttp/reverseproxy/fastcgi). It's a working draft - basic test performed with PHP-FPM & Go. I need feedback / review - I'm open to discuss how to progress with it and make it mergeable.
Solves: #85
Interesting the whole thing is just a HttpMessageHandler. Does it have uses outside of yarp that would warrant it being its own project?
I tried to make it as HttpMessageHandler to see how far I can go with it. It turn out doable with little tricks like DOCUMENT_ROOT is passed as HttpOption in request - its static option so it could be also passed in constructor. I don’t know if it’s useful for others, nowadays FastCGI is used mainly by PHP but let others give opinion on that.
@Tratcher Tests are still just for me to debug responses (I will add more & better at some point), but code of FastCgiHttpMessageHandler can be reviewed. I need some feedback to known if I'm going in a right direction with it.
🙌
Thank you for looking into this.
Given the relatively low demand for fastcgi in YARP and the high complexity of the implementation (new protocol, connection pool, security considerations), and the lack of familiarity with it on the team, we don't believe this repository is the right place for this logic at this time. Implementing the logic as a message handler is an interesting idea, with possible use outside of YARP. Since there doesn't seem to be anything YARP specific to the implementation (is there?), would you be interested in publishing the work in a separate repository / NuGet package?
Thanks for reply. I was planning to continue work on this next month (finally I have time). I understand Your decision. I don’t plan to release it as a separate package - too much work for one person to maintain it - ensuring future compatibility with YARP etc. I’m not sponsored - I was doing it voluntary in my spare time.