且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何编写服务器端应用程序以处理作为Web服务器的apache的http请求

更新时间:2023-10-17 20:32:10

我对现有库一无所知,是否有任何库可让您编写用于处理HTTP请求的服务器端应用程序,而Apache是​​Linux上的Web服务器? .

几件事:

客户端不依赖于服务器计算机类型或操作系统

服务器不取决于客户端计算机类型或其他任何内容.

您不必担心要处理哪种类型的Web服务器.您将不得不担心如何处理http协议.

只是为了测试,请执行此操作.

例如,在端口80上打开telnet(可能会根据保护号而变化)

I dont know anything about existing library.

few things:

client do not depends on server machine type or os

server do not depends on clients machine type or anything else.

you wont have to worry about what kind of webserver you are dealing with. you will have to worry about how will you handle http protocol.

just for a test, do this.

open telnet on port 80(it may vary based on prot number) as example

>telnet www.google.com 80
GET / HTTP/1.0


放在一行之后的两个新行.

那么您将收到来自http服务器的回复.您的telnet甚至不知道它是哪种服务器


exactly two new line after putting the line.

then you will get reply from http server. your telnet even dont know what kind of server it is