[HTTP] 2.URI์™€ ์›น๋ธŒ๋ผ์šฐ์ € ์š”์ฒญ ํ๋ฆ„

 

1. URI (Uniform Resource Identifier)

 

URI๋Š” Locator (๋กœ์ผ€์ดํ„ฐ)์™€ Name(์ด๋ฆ„) ๋‘˜ ๋‹ค ์ถ”๊ฐ€๋กœ ๋ถ„๋ฅ˜๋  ์ˆ˜ ์žˆ๋‹ค
URL : ๋ฆฌ์†Œ์Šค์˜ ์œ„์น˜
URN : ๋ฆฌ์†Œ์Šค์˜ ์ด๋ฆ„

 

- ์ฃผ๋กœ URL ์„ ์”€

 

URI์˜ ๋œป

Uniform : ๋ฆฌ์†Œ์Šค ์‹๋ณ„ํ•˜๋Š” ํ†ต์ผ๋œ ๋ฐฉ์‹

Resource : ์ž์›, URI๋กœ ์‹๋ณ„ํ•  ์ˆ˜ ์žˆ๋Š” ๋ชจ๋“  ๊ฒƒ(์ œํ•œ์—†์Œ)

Identifier : ์‹๋ณ„ ์ •๋ณด

 

URL : ๋ฆฌ์†Œ์Šค์˜ ์œ„์น˜ ์ง€์ •
URN : ๋ฆฌ์†Œ์Šค์— ์ด๋ฆ„ ๋ถ€์—ฌ

 

*URI๋ฅผ URL๊ณผ ๊ฐ™์€ ์˜๋ฏธ๋กœ ์‚ฌ์šฉํ•˜๋Š” ๊ฒƒ์ด ๋งŽ์Œ

 

 

[URL ๋ถ„์„]

scheme://[userinfo@]host[:port][/path][?query][#fragment]

[scheme (์Šคํ‚ค๋งˆ)

- ์ฃผ๋กœ ํ”„๋กœํ† ์ฝœ ์‚ฌ์šฉ

- ํ”„๋กœํ† ์ฝœ(์–ด๋–ค ๋ฐฉ์‹์œผ๋กœ ์ž์› ์ ‘๊ทผํ• ๊ฒƒ์ธ๊ฐ€ ์•ฝ์†ํ•˜๋Š” ๊ทœ์น™) -> ex) http, https, ftp ๋“ฑ

- http๋Š” 80ํฌํŠธ, https๋Š” 443ํฌํŠธ ์ฃผ๋กœ ์‚ฌ์šฉ, ํฌํŠธ ์ƒ๋žต๊ฐ€๋Šฅ

- https๋Š” http์— ๋ณด์•ˆ์ถ”๊ฐ€ (HTTP secure)

 

[userinfo]

- URL์— ์‚ฌ์šฉ์ž์ •๋ณด ํฌํ•จํ•ด์„œ ์ธ์ฆ

- ์‚ฌ์šฉX

 

[host]

- ํ˜ธ์ŠคํŠธ๋ช…

- ๋„๋ฉ”์ธ๋ช… ๋˜๋Š” IP ์ฃผ์†Œ๋ฅผ ์ง์ ‘ ์‚ฌ์šฉ๊ฐ€๋Šฅ

 

[port]

- ์ ‘์† ํฌํŠธ

- ์ผ๋ฐ˜์ ์œผ๋กœ ์ƒ๋žต๊ฐ€๋Šฅ, ์ƒ๋žต์‹œ http๋Š” 80, https๋Š” 443

 

[path]

- ๋ฆฌ์†Œ์Šค๊ฐ€ ์žˆ๋Š” ๊ฒฝ๋กœ (๊ณ„์ธต์  ๊ตฌ์กฐ)

 

[query]

- key=value ํ˜•ํƒœ

- ?๋กœ ์‹œ์ž‘, &๋กœ ์ถ”๊ฐ€๊ฐ€๋Šฅ 

   ex) ?keyA=valueA&keyB=valueB

- query parameter, query string ์œผ๋กœ ๋ถˆ๋ฆผ

- ์›น์„œ๋ฒ„์— ์ œ๊ณตํ•˜๋Š” ํŒŒ๋ผ๋ฏธํ„ฐ, ๋ฌธ์ž ํ˜•ํƒœ

 

[fragment]

- html ๋‚ด๋ถ€ ๋ถ๋งˆํฌ ๋“ฑ์— ์‚ฌ์šฉ

- ์„œ๋ฒ„์— ์ „์†กํ•˜๋Š” ์ •๋ณด ์•„๋‹˜

- ์ž˜ ์‚ฌ์šฉ X


2. ์›น ๋ธŒ๋ผ์šฐ์ € ์š”์ฒญ ํ๋ฆ„

ํ๋ฆ„

https://www.google.com:443/search?q=hello&hl=ko

์š”์ฒญ

-> DNS ์„œ๋ฒ„ ์กฐํšŒ, IP 200.200.200.2

-> PORT 443

-> HTTP ์š”์ฒญ ๋ฉ”์‹œ์ง€ ์ƒ์„ฑ

http ์š”์ฒญ ๋ฉ”์‹œ์ง€

-> ๋ฉ”์‹œ์ง€ ์ „์†ก

     1) ์›น๋ธŒ๋ผ์šฐ์ €๊ฐ€ HTTP ๋ฉ”์‹œ์ง€ ์ƒ์„ฑ  

     2) Socket ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋ฅผ ํ†ตํ•ด ์ „๋‹ฌ (A: TCP/IP ์—ฐ๊ฒฐ(IP, PORT), B: ๋ฐ์ดํ„ฐ ์ „๋‹ฌ)

     3) TCP/IP ํŒจํ‚ท ์ƒ์„ฑ, HTTP ๋ฉ”์‹œ์ง€ ํฌํ•จ

     4) LANํ†ตํ•ด ์ธํ„ฐ๋„ท์œผ๋กœ ํ˜๋Ÿฌ๊ฐ

 

 

  • ๋„ค์ด๋ฒ„ ๋ธ”๋Ÿฌ๊ทธ ๊ณต์œ ํ•˜๊ธฐ
  • ๋„ค์ด๋ฒ„ ๋ฐด๋“œ์— ๊ณต์œ ํ•˜๊ธฐ
  • ํŽ˜์ด์Šค๋ถ ๊ณต์œ ํ•˜๊ธฐ
  • ์นด์นด์˜ค์Šคํ† ๋ฆฌ ๊ณต์œ ํ•˜๊ธฐ