1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
| root@tzj-virtual-machine:/opt/http# vim hello.c
#include <stdio.h>
int main() { printf("hello world\n");
return 0; }
# 编译 root@tzj-virtual-machine:/opt/http# gcc hello.c -o hello.cgi
# 启动http root@tzj-virtual-machine:/opt/http# ./myhttp start listen 80 success myhttp begin
# root@tzj-virtual-machine:/opt/http# ./myhttp start listen 80 success myhttp begin root@tzj-virtual-machine:/opt/http# accept by 172.16.140.1 thread is begin recv: GET /hello.cgi HTTP/1.1 Host: 172.16.140.199 Connection: keep-alive Cache-Control: max-age=0 Upgrade-Insecure-Requests: 1 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7 Accept-Encoding: gzip, deflate Accept-Language: zh-CN,zh;q=0.9
accept by 172.16.140.1 thread is begin headbuf: HTTP/1.1 200 OK Content-Type: text/html Content-Length:12
thread_is end recv: GET /favicon.ico HTTP/1.1 Host: 172.16.140.199 Connection: keep-alive User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36 Accept: image/avif,image/webp,image/apng,image/svg+xml,image/*,*/*;q=0.8 Referer: http://172.16.140.199/hello.cgi Accept-Encoding: gzip, deflate Accept-Language: zh-CN,zh;q=0.9
headbuf: HTTP/1.1 200 OK Content-Type: image/x-icon Content-Length:2550
thread_is end
|