Skip to content
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

Integrating FastCGI into uhttpd: A Request for Support from OpenWrt Developers #12

Open
QiaoTuCodes opened this issue Oct 3, 2024 · 3 comments

Comments

@QiaoTuCodes
Copy link

I need to port FastCGI to uhttpd or migrate mod_fastcgi.c from Lighttpd into uhttpd. I would like to consult the OpenWrt development team for possible solutions regarding this matter. We look forward to your help and support. Thank you so much!

@stokito
Copy link

stokito commented Oct 3, 2024

You better to ask in the devlist https://lists.infradead.org/mailman/listinfo/openwrt-devel
This repo is a mirror and devs may not see your feature request.

I'm not an OpenWrt developer but I'm skeptical on this. The uhttpd started as a replacement for the BusyBox httpd to support TLS/HTTPS and native Lua execution. Now routers become more powerful and the project is not really needed because you can use the Lighttpd or even Nginx.

Today router manufactures use the Lighttpd instead of the uhttpd. The FastCGI is implemented there and actually this is not so difficult thing in less that 600 lines:

https://redmine.lighttpd.net/projects/lighttpd/repository/14/revisions/master/entry/src/mod_fastcgi.c

You may try to reuse the code but it has a different license that may be problematic.

@QiaoTuCodes
Copy link
Author

你最好在开发列表中询问https://lists.infradead.org/mailman/listinfo/openwrt-devel。 这个repo是一个镜像,开发人员可能看不到你的功能请求。

我不是 OpenWrt 开发人员,但我对此持怀疑态度。uhttpd 最初是作为 BusyBox httpd 的替代产品推出的,用于支持 TLS/HTTPS 和原生 Lua 执行。现在路由器功能越来越强大,这个项目已经不再需要,因为您可以使用 Lighttpd 甚至 Nginx。

现在路由器制造商使用 Lighttpd 代替 uhttpd。FastCGI 在那里实现,实际上这并不难,只需不到 600 行代码:

https://redmine.lighttpd.net/projects/lighttpd/repository/14/revisions/master/entry/src/mod_fastcgi.c

您可以尝试重复使用该代码,但它具有不同的许可证,可能会出现问题。

Thank you for your help and answers. I don’t have high hopes, but seeing that mod_fastcgi.c is only some lines of code, integrating it shouldn’t be too difficult. My main concern is that I have a project focused on reducing the image size, and I hope to make it small enough to free up more usable space for running other applications on the SoC. Currently, it seems that Lighttpd is still too large, so I will attempt the porting. By the way, thank you for informing me that this repo is a mirror; I have since migrated to https://lists.infradead.org/mailman/listinfo/openwrt-devel to request more help. Thank you very much!

@gstrauss
Copy link

gstrauss commented Oct 8, 2024

In what ways is lighttpd "too large"?
The lighttpd wiki provides guidance on how to tune lighttpd to be smaller and/or faster:
https://wiki.lighttpd.net/Docs_ResourceTuning
https://wiki.lighttpd.net/Docs_Performance

For example: uhttpd does not support HTTP/2. If you want to compare lighttpd and uhttpd sizes, you can disable HTTP/2 support in lighttpd (resulting in a smaller lighttpd memory footprint at runtime) with lighttpd.conf server.feature-flags += ("server.h2proto" => "disable")

Another example: if you're using TLS, uhttpd uses mbedtls. lighttpd supports multiple TLS libraries. Make sure you are using lighttpd mod_mbedtls to compare with uhttpd. The defaults in lighttpd is to use lighttpd mod_openssl, which can be much faster, but uses much more memory than lighttpd mod_mbedtls.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants