-
-
Notifications
You must be signed in to change notification settings - Fork 383
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: Add fastCGI support please #88
Comments
I personally hope you guys can prioritize this over https support since fastCGI is more important in real world. It is also much simpler to implement fastCGI compared to https. |
Thanks for the suggestion and the information. Your main criticism seems to be against 2 things:
As far as the criticisms are concerned, We do not expect people to run Crow directly or proxy over HTTPS Even in the original repository's issues, it is mentioned that you should use a proxy and that you probably should not proxy over https. As for using FastCGI to solve these concerns, this is where I start to disagree. The primary comparison here is proxying over FastCGI vs HTTP/1.1 You mention that FastCGI is binary as opposed to text and supports multiplexing, which is similar to HTTP/2, and carries the same concerns that:
Other points to consider regarding FastCGI is that:
All of that makes something like FastCGI a very had sell, let alone giving it priority over features that help complete or simplify the process of working with crow. I like systems that run fast and efficient, but I'm not gonna lie to you. At the moment FastCGI is further down the list than HTTP/2, which I've been delaying since I started working on Crow. There is already a PR (ipkn#379) That adds a simple form of Unix Domain Socket support to Crow. If you'd like to add FastCGI implementation yourself. I suggest you start there. I will also look into it, but once more I cannot spare much time trying to implement it, especially given how difficult it is to find people or time to work on Crow. Thank you once more for the informative issue, and the suggestion. |
After looking into the source for a little, I think it is understandable that you didn't prioritize this since the entire structure of I would look into fastCGI myself and see if I can help. |
@The-EDev I also checked fastCGI spec and IMHO the header is actually quite simple:
However, it does make me suspect whether fastCGI is worth it, as it is so simple and still sends information like hostname, cookies, uri via text. It does save parsing 'name=val' by sending structure like
but that doesn't make a lot of difference and might even make performance worse since it needs to also send The only benefit from fastCGI as far as I seen is the multiplexing and pretty much anything else doesn't have any real benefit for the content server. But even multiplexing might not have any real benefits since in real world, the network between the reverse proxy and the content server are pretty good and having multiple TCP connection really isn't a big problem. It seems that fastCGI is exactly as what it is advertised: a replacement for CGI and isn't of much benefit to |
I guess the only way to make This would make |
@NobodyXu I did think of that, I'm not sure how Nginx and Apache modules work, but I believe flask does something similar using Werkzeug, only thing is how do you link the 2 (Crow and the server program), but if that approach works it'll be very beneficial. |
I just took a look at one of the modules listed on nginx’s wiki: mod_zip, and found information on installation in
I also found config, which is probably important for the building of the module. Upon further investigation of its ngx_http_zip_module.c, I was able to identify the necessary data structure for a module:
|
It seems that the module can either be loaded dynamically or statically as addon:
The code above is taken from config. |
The discussion here can continue at #94 |
Most people building websites nowadays use
nginx
orappache
to reverse proxy the real dynamic content server instead of directly expose the underlying server directly asThe http/https code in
nginx
andappache
are much more battle tested and has less bug.nginx
andappache
is probably much better thancrow
nginx
andappache
and know how to tune them. Some might even has special patch applied to them for their own use caseThe https server could run as root while the content server can run as a normal user.
Any bug in content server won't cause privilege escalation or crash in https server and the user won't feel the crash of content server as the server can be restarted in background without the https connection being closed.
There are broader audience who needs fastCGI in their content server.
While
nginx
andappache
can also proxy http, it is slower than fastCGI asand nobody in their right mind would proxy their underlying content server over https as it is too heavy weight.
The right solution here is fastCGI. It is designed for this kind of application, so the experience programming with fastCGI is probably better than http.
Thus I think crow should have fastCGI support as it is extremely important.
I found archive of the specification of fastCGI here and it also has a reference implementation of fastCGI library fcgi2.
There are also kcgi and fastcgipp that are
C
andC++
server that supports fastCGI.The text was updated successfully, but these errors were encountered: