Là một dự án mã nguồn mở, EZLippi/Tinyhttpd đã đạt 12.2k sao trên GitHub, ngôn ngữ C. Tinyhttpd 是J. David Blackstone在1999年写的一个不到 500 行的超轻量型 Http Server,用来学习非常不错,可以帮助我们真正理解服务器程序的本质。官网:http://tinyhttpd.sourceforge.net
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
A mirror for tinyhttpd(Tinyhttpd非官方镜像,Fork自sourceForge,仅供学习)
测试CGI时需要本机安装PERL,同时安装perl-cgi
Prepare
Compile for Linux
To compile for Linux:
1) Comment out the #include <pthread.h> line.
2) Comment out the line that defines the variable newthread.
3) Comment out the two lines that run pthread_create().
4) Uncomment the line that runs accept_request().
5) Remove -lsocket from the Makefile.
(9) 在父进程中,关闭 cgi_input 的读取端 和 cgi_output 的写入端,如果 POST 的话,把 POST 数据写入 cgi_input,已被重定向到 STDIN,读取 cgi_output 的管道输出到客户端,该管道输入是 STDOUT。接着关闭所有管道,等待子进程结束。这一部分比较乱,见下图说明:
图 1 管道初始状态
图 2 管道最终状态
(10) 关闭与浏览器的连接,完成了一次 HTTP 请求与回应,因为 HTTP 是无连接的。
以下内容来自源作者:
This software is copyright 1999 by J. David Blackstone. Permission
is granted to redistribute and modify this software under the terms of
the GNU General Public License, available at http://www.gnu.org/ .
If you use this software or examine the code, I would appreciate
knowing and would be overjoyed to hear about it at
[email protected] .
This software is not production quality. It comes with no warranty
of any kind, not even an implied warranty of fitness for a particular
purpose. I am not responsible for the damage that will likely result
if you use this software on your computer system.
I wrote this webserver for an assignment in my networking class in
1999. We were told that at a bare minimum the server had to serve
pages, and told that we would get extra credit for doing "extras."
Perl had introduced me to a whole lot of UNIX functionality (I learned
sockets and fork from Perl!), and O'Reilly's lion book on UNIX system
calls plus O'Reilly's books on CGI and writing web clients in Perl got
me thinking and I realized I could make my webserver support CGI with
little trouble.
Now, if you're a member of the Apache core group, you might not be
impressed. But my professor was blown over. Try the color.cgi sample
script and type in "chartreuse." Made me seem smarter than I am, at
any rate. :)
Apache it's not. But I do hope that this program is a good
educational tool for those interested in http/socket programming, as
well as UNIX system calls. (There's some textbook uses of pipes,
environment variables, forks, and so on.)
One last thing: if you look at my webserver or (are you out of
mind?!?) use it, I would just be overjoyed to hear about it. Please
email me. I probably won't really be releasing major updates, but if
I help you learn something, I'd love to know!
EZLippi/Tinyhttpd có 12.2k sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/EZLippi/Tinyhttpd. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
EZLippi/Tinyhttpd có tag gì không?
Bản đồng bộ chưa ghi nhận topic GitHub nào cho EZLippi/Tinyhttpd. GitHub topics hiển thị ở thanh bên phải trang repo — đó là nơi đáng kiểm tra nhất.
EZLippi/Tinyhttpd còn đang phát triển không?
Commit gần nhất trên EZLippi/Tinyhttpd là 3.1 năm trước (theo timestamp GitHub). Repo có 3.9k fork — một chỉ báo về mức độ quan tâm của cộng đồng.
EZLippi/Tinyhttpd là gì?
EZLippi/Tinyhttpd (EZLippi/Tinyhttpd) là dự án C trên GitHub. Theo mô tả gốc: Tinyhttpd 是J. David Blackstone在1999年写的一个不到 500 行的超轻量型 Http Server,用来学习非常不错,可以帮助我们真正理解服务器程序的本质。官网:http://tinyhttpd.sourceforge.net
EZLippi/Tinyhttpd viết bằng ngôn ngữ gì?
EZLippi/Tinyhttpd chủ yếu viết bằng C. Trường "language" của GitHub dựa trên phần lớn byte ở nhánh mặc định.
Đọc đầy đủ README ở tab phía trên.
Vẫn đang phân vân về Tinyhttpd?
Một cú bấm sẽ gửi câu hỏi kèm trang này cho AI — xem AI nói gì về Tinyhttpd.