Header

  1. View current page

    studioego

Profile_img_60x60_01
0

1장

1장. 간단한 웹 서버

Web Server는 Client(주로 Web Browser)와 통신할 때 HTTP(HyperText Transfer Protocol)을 사용하기 때문에 HTTP 서버라고 함.

자바 기반의 웹서버는 2개의 중요한 클래스를 사용

  • java.net.Socket
  • java.net.ServerSocket

HTTP(HyperText Transfer Protocol)

 

 

 

실행결과

 

 

GET /index.html HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/x-silverlight, application/xaml+xml, application/vnd.ms-xpsdocument, application/x-ms-xbap, application/x-ms-application, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*
Accept-Language: ko
UA-CPU: x86
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; InfoPath.2; .NET CLR 3.0.04506.648)
Host: localhost:8000
Connection: Keep-Alive

GET /images/logo.gif HTTP/1.1
Accept: */*
Referer: http://localhost:8000/index.html
Accept-Language: ko
UA-CPU: x86
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; InfoPath.2; .NET CLR 3.0.04506.648)
Host: localhost:8000
Connection: Keep-Alive

GET /favicon.ico HTTP/1.1
Accept: */*
UA-CPU: x86
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; InfoPath.2; .NET CLR 3.0.04506.648)
Host: localhost:8000
Connection: Keep-Alive

 

History

Last edited on 07/21/2008 18:10 by StudioEgo

Comments (0)

You must log in to leave a comment. Please sign in.