在创建纯C的Web服务器 [英] Creating a web server in pure C
问题描述
Im做我的大学现在涉及仅用C.创建一个web服务器一个小项目,我知道一些关于HTTP 1.1和我创建了一个C#之前的网络服务器。
Im doing a little project on my university which now involves in creating a webserver only using C. I know a little about HTTP 1.1 and I've created a webserver in C# before.
不过,我倒要看看你怎么要么套接字编程和使用C中的多线程,或者如何否则将创建在C网络服务器开始。
However, I'd like to see how you would either begin with socket programming and using multi threads in C, or how you would otherwise create a webserver in C.
真的有没有太多的要求,我只是想开始使用一个小插座,监听端口80,发送一些文字respons到Web服务器/远程登录客户端。也许有些code结构的建议是帮助了。最大的要求是可能是它的Linux版本。
There's not really a lot of requirements, I'd just like to get started with a little socket, listening to port 80, sending out some respons text to the webserver / telnet-client. And maybe some code-structure advice would be of help too. The biggest requirement is probably that its for Linux.
推荐答案
当我在网络编程课程类似的任务,我用 Beej的引导网络编程。我只需要编写处理GET和POST请求一个简单的服务器,但Beej的指南让我一路走过的项目。
When I had a similar assignment in a network programming course I used Beej's Guide to Network Programming. I only had to write a simple server that handled GET and POST requests, but Beej's Guide got me all the way through the project.
这篇关于在创建纯C的Web服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!