SlideShare une entreprise Scribd logo
1  sur  50
Télécharger pour lire hors ligne
HTTP 
!" #$%"r$"%& 
'()%#'"*#+ 
,-(r#"r
A bit of 
History 
First
1945 – THE MEMEX SYSTEM Microfilm management 
1965 – HyperText Project Xanadu 
1991 – HTTP 0.9 GET only 
1996 – HTTP 1.0 Headers, MIME, … 
1997 – HTTP 1.1 Flaw correction 
1998 – HTTP-NG stopped 
2015 – HTTP/2 RFC Publish date
What about HTTP-NG? 
It was planned to replace HTTP-1.1… 
Nah, HTTP-1.1 worked – 
no one wanted to adapt 
HTTP-NG and replace 1.1! 
By now we don’t need it 
anymore…
Uniform 
Resource 
Locator
The Navigator 
Berners-Lees’ “Biggest Mistake” 
<scheme>://<user>:<password>@<host>:<port> 
/<path>;<params>?<query>#<frag>
URLs are 
7-BIT 
US-ASCII
Small and safe alphabet 
Readable by people 
always complete 
Encoding%20Bypasses%20limitations 
Reserved Characters (most of them) 
% / . .. # ? ; : $ , + @ & = { } |  ^ [ ] ‘ < > “
The Future of URL
Uniform resource name 
stable name for an object 
Persistend uRL 
URN through URL 
using a resource locator server 
URN 
PURL
HTTP 
Messages
Request 
GET / HTTP/1.1 
Host: www.namics.com 
Accept: text/html 
CLIENT Server 
Response 
HTTP/1.1 200 OK 
Server: nginx/1.4.3 
Content-Type: text/html; 
Content-Length: 4323 
GET / HTTP/1.1 Start line 
Headers 
Body 
Host: www.namics.com [CRLF] 
Accept: text/html [CRLF] 
[CRLF] 
HTTP/1.1 200 OK 
Content-Type: text/html [CRLF] 
Server: nginx/1.4.3 [CRLF] 
[CRLF] 
<html>…</html> 
Plain ASCII 
Plain ASCII
Common 
Methods
safe Methods 
No action on server 
GET 
HEAD 
PUT 
POST 
Patch 
TRACE 
Options 
Delete 
Message With 
Body 
Send data to server 
HTTP/1.1 must implement this method 
Inspect resource headers 
Deposit data on server – inverse of get 
Send input data for processing 
Partially modify a resource 
Echo back received message 
Server capabilities 
Delete a resource – not guaranteed
STATUS 
CODES
1xx 100-101 Informational 
2xx 200-206 Successful 
3xx 300-305 Redirection 
4xx 400-415 Client error 
5xx 500-505 Server error
You Should know the most important ones! 
http://httpstatus.es 
Statuses are primarily for agents (Browsers) 
THE HTTP Protocol Version of the client 
DetermineS HOW IT Processes STATUS CODES!
TRIVIA 
Created Response also contains a Location Header 
Multiple Choices Preferred URL in Location Header 
Request Timeout Close the connection 
Gone Resource one was on the server 
Service currently unavailable 
Motherfucking Snakes on the Motherfucking Plane 
201 
300 
408 
410 
503 
747
Everything is 
Extendable 
You may create your own headers, methods and status codes 
You may not implement some methods or header logic
Standard 
Headers
Headers are about Information 
General Client and Server 
Request Client Requests 
Response Server Responses 
Entity Describe Entity body 
Extension Non-Standard
GENERAL Headers 
Response Header from www.namics.com 
HTTP/1.1 200 OK 
Server: nginx/1.4.3 
Date: Mon, 13 Oct 2014 16:18:08 GMT 
Transfer-Encoding: chunked 
Connection: keep-alive 
Via: 1.1 varnish 
Content-Type: text/html; charset=utf-8 
X-Mod-Pagespeed: 1.6.29.7-3343 
Vary: Accept-Encoding 
X-Powered-By: Secret Namics rocket technology 
X-Varnish: 1491545138 1491540973 
Age: 1110
Request Headers 
Request Header From Chrome 
GET / HTTP/1.1 
Host: namics.com 
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_5 
Connection: keep-alive 
Accept: text/html,application/xhtml+xml,application/xml; 
q=0.9,image/webp,*/*;q=0.8 
Accept Headers 
Capabilities + Preferences 
Accept-Encoding: gzip,deflate,sdch 
Accept-Language: en-US,en;q=0.8,de;q=0.6 
Cookie: my_namics_SSL=1; LtpaToken=AAECAzU0M0I3RTlBNTQzQkZEMkFDTj1 
q: Quality factor - Relative degree of preference
Response Headers 
Response Header from www.namics.com 
HTTP/1.1 200 OK 
Date: Mon, 13 Oct 2014 16:18:08 GMT 
Transfer-Encoding: chunked 
Connection: keep-alive 
Server: nginx/1.4.3 
Content-Type: text/html; charset=utf-8 
Vary: Accept-Encoding 
Age: 1110 
X-Mod-Pagespeed: 1.6.29.7-3343 
X-Powered-By: Secret Namics rocket technology 
X-Varnish: 1491545138 1491540973 
Via: 1.1 varnish 
Extension Headers 
Fully Custom
CONNECTION 
MANAGEMENT
- Reliable - 
No damaged or 
scrambled data! 
G!"r"#$%%&!
HTTP 
TSL OR SSL 
TCP 
IP 
Network interfaces 
Application Layer 
Security Layer 
Transport Layer 
Network Layer 
Data Link Layer 
That’s Why!
TCP 
Connections
CLIENT Server 
COMMUNICATION 
Create Socket 
Bind socket to port 80 
Accept Connections 
DNS Lookup 
Create Socket 
Bind Socket 
Connection 
Handshake 
Delay 
SYN 
SYN+ACK 
Read 
Process 
ACK 
GET / HTTP/1.1 
HTTP/1.1 200 Ok 
Data transfer 
Close connection 
Connection properties 
Source IP, Source Port, Destination IP, Destination Port UNIQUE
Performance considerations 
Considerable delay for 
small Transactions 
Performance depends on connection age 
For 1 successfully received packet, 
the sender can send 2 more 
Bundles up large amounts of tcp data 
for efficiency 
Non-full size packets can only be sent if 
all others are acknoleged 
SYN/SYN+ACK 
Handshake 
TCP Slow Start 
congestion control 
feature 
Nagle’s Algorithm
HTTP 
Connections
The Connection Header 
HTTP/1.1 200 OK 
Connection: myheader, close 
Myheader: local information 
CLIENT Server 
Proxy 
Myheader is a hop-by-hop header and not proxied 
Messages are forwarded - each “Hop” must delete 
header fields listed in the connection header 
This allows protecting “local headers”
Connection Types 
“Feel” faster - but still tcp performance issues 
2 to 6 per client (browser) is current practice 
HTTP/1.0+ experimental, deprecated but still used 
Handled by keep-alive connection header 
HTTP/1.1 Re-use connections for multiple requests 
Active by default, explicitly close by header 
Only works with correct Content-Length 
Enqueue multiple requests over persistent 
connection before response arrives 
only for safe methods (not for “post”) 
Parallel 
Keep-Alive 
Persistent 
Pipelined
The Keep-Alive Problem 
CLIENT Server 
GET / HTTP/1.0 
Host: www.namics.com 
Connection: keep-alive 
HTTP/1.0 200 OK 
Connection: keep-alive 
Content-type: text/html 
Connection: keep-alive Connection: keep-alive 
CLIENT Dumb Proxy Server 
Connection: keep-alive 
SHOULD NOT BE PASSED 
Connection: keep-alive 
Proxy waits for connection close 
Connection: keep-alive 
Ignore request - still waiting for close
Connection Close 
It can happen anytime 
If it happens, client should reopen 
and retry once for methods 
without side effects 
(Get is ok, Post is not!)
A quick 
HTTP/2 Breakout 
Spdy Protocol
GoogleS’ Contribution 
Speedy Open Networking Protocol 
Focus on Performance 
Base for HTTP/2 draft 
HTTP - SPDY - TCP 
1 TCP Connection 
Multiplexing 
Stream priorities 
SSL by default 
Compressed headers 
… and more
HANDLING 
STATELESSNESS 
Coping with the “goldfish memory”
Enter cookies 
First developed by netscape 
Define new extension headers 
Cookie, Cookie2, Set-Cookie, Set-Cookie2 
Flavors are 
session cookies and persistent cookies
DOMAIN ATTRIBUTE CONTROLS THE “VISIBILIY” 
PATH ATTRIBUTE ALLOWS FINER-GRAINED 
CONTROL 
COOKIES ARE STATE INFORMATION 
MAINTAINED BY THE CLIENT 
COOKIES ARE NOT PART OF HTTP/1.1 
SPECIFICATION
VERSION 0 - NETSCAPE COOKIES 
Cookie: name1=value1 
[; name2=value2] 
Set-Cookie: name=value 
[; expires=date] 
[; path=path] 
[; domain=domain] [; secure] 
Request Header 
Response Header
VERSION 1 – RFC2956 COOKIES 
Descriptive text for cookies 
Forced destruction support on browser exit 
Max-age in relative seconds, not date 
Rfc6265 lists them as deprecated 
Controlled by Set-Cookie2 and Cookie2
Cookies + Caching 
Short answer 
“NO”
Cookies and Security 
Cookies are a security risk 
DNS Poisoning 
Cross site scripting 
Attacks 
Vulnerable To
Cookies Alternatives 
HTML5 Browser storage 
Browser / canvas fingerprint 
HTTP Authentication 
ETAG Headers
Zombie 
and 
EverCookies
The evil 
a Javascript api to create zombie cookies 
https://github.com/samyk/evercookie 
uses every possible way to store cookies 
and avoid deletion 
FBI uses it to track TOR users 
Spotify uses it
HTTP 
CACHING 
Pr"&"$%"* b. C/r#& $0% w""1 
J
Things I’Ve missed… 
Authorization and Security 
Proxies and Gateways 
Robots 
Entities and Encodings 
Content Negotiation 
7xx status codes extension proposal 
…
418 
I’m a teapot 
(http://tools.ietf.org/html/rfc2324)

Contenu connexe

Tendances

Tendances (20)

What's up with HTTP?
What's up with HTTP?What's up with HTTP?
What's up with HTTP?
 
Hypertex transfer protocol
Hypertex transfer protocolHypertex transfer protocol
Hypertex transfer protocol
 
HTTP Protocol Basic
HTTP Protocol BasicHTTP Protocol Basic
HTTP Protocol Basic
 
HyperText Transfer Protocol (HTTP)
HyperText Transfer Protocol (HTTP)HyperText Transfer Protocol (HTTP)
HyperText Transfer Protocol (HTTP)
 
Http - All you need to know
Http - All you need to knowHttp - All you need to know
Http - All you need to know
 
HTTP & HTML & Web
HTTP & HTML & WebHTTP & HTML & Web
HTTP & HTML & Web
 
HyperText Transfer Protocol
HyperText Transfer ProtocolHyperText Transfer Protocol
HyperText Transfer Protocol
 
HTTP Presentation
HTTP Presentation HTTP Presentation
HTTP Presentation
 
Lec 7(HTTP Protocol)
Lec 7(HTTP Protocol)Lec 7(HTTP Protocol)
Lec 7(HTTP Protocol)
 
HTTP
HTTPHTTP
HTTP
 
HTTP
HTTPHTTP
HTTP
 
Http basics by-joshi_29_4_15-ppt
Http basics by-joshi_29_4_15-pptHttp basics by-joshi_29_4_15-ppt
Http basics by-joshi_29_4_15-ppt
 
HTTP
HTTPHTTP
HTTP
 
Hypertext transfer protocol (http)
Hypertext transfer protocol (http)Hypertext transfer protocol (http)
Hypertext transfer protocol (http)
 
Http Introduction
Http IntroductionHttp Introduction
Http Introduction
 
Web and http computer network
Web and http computer networkWeb and http computer network
Web and http computer network
 
Hypertext Transfer Protocol
Hypertext Transfer ProtocolHypertext Transfer Protocol
Hypertext Transfer Protocol
 
HTTP & WWW
HTTP & WWWHTTP & WWW
HTTP & WWW
 
Http VS. Https
Http VS. HttpsHttp VS. Https
Http VS. Https
 
Http Protocol
Http ProtocolHttp Protocol
Http Protocol
 

En vedette

Code Kata Workshop - Improve your skills through deliberate practice
Code Kata Workshop - Improve your skills through deliberate practiceCode Kata Workshop - Improve your skills through deliberate practice
Code Kata Workshop - Improve your skills through deliberate practiceDaniel Kummer
 
Introduction to HTTP
Introduction to HTTPIntroduction to HTTP
Introduction to HTTPYihua Huang
 
ASP.NET Web API and HTTP Fundamentals
ASP.NET Web API and HTTP FundamentalsASP.NET Web API and HTTP Fundamentals
ASP.NET Web API and HTTP FundamentalsIdo Flatow
 
Introduction to HTTP protocol
Introduction to HTTP protocolIntroduction to HTTP protocol
Introduction to HTTP protocolAviran Mordo
 
A Guide to SlideShare Analytics - Excerpts from Hubspot's Step by Step Guide ...
A Guide to SlideShare Analytics - Excerpts from Hubspot's Step by Step Guide ...A Guide to SlideShare Analytics - Excerpts from Hubspot's Step by Step Guide ...
A Guide to SlideShare Analytics - Excerpts from Hubspot's Step by Step Guide ...SlideShare
 

En vedette (8)

Http
HttpHttp
Http
 
Code Kata Workshop - Improve your skills through deliberate practice
Code Kata Workshop - Improve your skills through deliberate practiceCode Kata Workshop - Improve your skills through deliberate practice
Code Kata Workshop - Improve your skills through deliberate practice
 
6 app-tcp
6 app-tcp6 app-tcp
6 app-tcp
 
Introduction to HTTP
Introduction to HTTPIntroduction to HTTP
Introduction to HTTP
 
ASP.NET Web API and HTTP Fundamentals
ASP.NET Web API and HTTP FundamentalsASP.NET Web API and HTTP Fundamentals
ASP.NET Web API and HTTP Fundamentals
 
HTTP Basics
HTTP BasicsHTTP Basics
HTTP Basics
 
Introduction to HTTP protocol
Introduction to HTTP protocolIntroduction to HTTP protocol
Introduction to HTTP protocol
 
A Guide to SlideShare Analytics - Excerpts from Hubspot's Step by Step Guide ...
A Guide to SlideShare Analytics - Excerpts from Hubspot's Step by Step Guide ...A Guide to SlideShare Analytics - Excerpts from Hubspot's Step by Step Guide ...
A Guide to SlideShare Analytics - Excerpts from Hubspot's Step by Step Guide ...
 

Similaire à HTTP

Computer network (10)
Computer network (10)Computer network (10)
Computer network (10)NYversity
 
Проксирование HTTP-запросов web-акселератором / Александр Крижановский (Tempe...
Проксирование HTTP-запросов web-акселератором / Александр Крижановский (Tempe...Проксирование HTTP-запросов web-акселератором / Александр Крижановский (Tempe...
Проксирование HTTP-запросов web-акселератором / Александр Крижановский (Tempe...Ontico
 
Interactive web. O rly?
Interactive web. O rly?Interactive web. O rly?
Interactive web. O rly?timbc
 
Under the Covers with the Web
Under the Covers with the WebUnder the Covers with the Web
Under the Covers with the WebTrevor Lohrbeer
 
Web Fundamentals
Web FundamentalsWeb Fundamentals
Web Fundamentalsarunv
 
Revisiting HTTP/2
Revisiting HTTP/2Revisiting HTTP/2
Revisiting HTTP/2Fastly
 
Presentation (PowerPoint File)
Presentation (PowerPoint File)Presentation (PowerPoint File)
Presentation (PowerPoint File)webhostingguy
 
Presentation (PowerPoint File)
Presentation (PowerPoint File)Presentation (PowerPoint File)
Presentation (PowerPoint File)webhostingguy
 
DEF CON 27- ALBINOWAX - http desync attacks
DEF CON 27- ALBINOWAX - http desync attacksDEF CON 27- ALBINOWAX - http desync attacks
DEF CON 27- ALBINOWAX - http desync attacksFelipe Prado
 
IBM dwLive, "Internet & HTTP - 잃어버린 패킷을 찾아서..."
IBM dwLive, "Internet & HTTP - 잃어버린 패킷을 찾아서..."IBM dwLive, "Internet & HTTP - 잃어버린 패킷을 찾아서..."
IBM dwLive, "Internet & HTTP - 잃어버린 패킷을 찾아서..."Dongwook Lee
 
Web Application Security 101 - 02 The Basics
Web Application Security 101 - 02 The BasicsWeb Application Security 101 - 02 The Basics
Web Application Security 101 - 02 The BasicsWebsecurify
 
Introducing HTTP/2
Introducing HTTP/2Introducing HTTP/2
Introducing HTTP/2Ido Flatow
 
HTTP/2 Introduction
HTTP/2 IntroductionHTTP/2 Introduction
HTTP/2 IntroductionWalter Liu
 
Introduction to HTTP/2
Introduction to HTTP/2Introduction to HTTP/2
Introduction to HTTP/2Ido Flatow
 
Implementing Early Hints in Chrome - Approaches and Challenges
Implementing Early Hints in Chrome - Approaches and ChallengesImplementing Early Hints in Chrome - Approaches and Challenges
Implementing Early Hints in Chrome - Approaches and ChallengesViet-Hoang Tran
 
20190516 web security-basic
20190516 web security-basic20190516 web security-basic
20190516 web security-basicMksYi
 
Basic IT 2 (General IT Knowledge-2)
Basic IT 2 (General IT Knowledge-2)Basic IT 2 (General IT Knowledge-2)
Basic IT 2 (General IT Knowledge-2)kholis_mjd
 
Hidden Gems in HTTP
Hidden Gems in HTTPHidden Gems in HTTP
Hidden Gems in HTTPBen Ramsey
 

Similaire à HTTP (20)

Http2 kotlin
Http2   kotlinHttp2   kotlin
Http2 kotlin
 
Computer network (10)
Computer network (10)Computer network (10)
Computer network (10)
 
Проксирование HTTP-запросов web-акселератором / Александр Крижановский (Tempe...
Проксирование HTTP-запросов web-акселератором / Александр Крижановский (Tempe...Проксирование HTTP-запросов web-акселератором / Александр Крижановский (Tempe...
Проксирование HTTP-запросов web-акселератором / Александр Крижановский (Tempe...
 
Interactive web. O rly?
Interactive web. O rly?Interactive web. O rly?
Interactive web. O rly?
 
Under the Covers with the Web
Under the Covers with the WebUnder the Covers with the Web
Under the Covers with the Web
 
Web Fundamentals
Web FundamentalsWeb Fundamentals
Web Fundamentals
 
Revisiting HTTP/2
Revisiting HTTP/2Revisiting HTTP/2
Revisiting HTTP/2
 
Http2
Http2Http2
Http2
 
Presentation (PowerPoint File)
Presentation (PowerPoint File)Presentation (PowerPoint File)
Presentation (PowerPoint File)
 
Presentation (PowerPoint File)
Presentation (PowerPoint File)Presentation (PowerPoint File)
Presentation (PowerPoint File)
 
DEF CON 27- ALBINOWAX - http desync attacks
DEF CON 27- ALBINOWAX - http desync attacksDEF CON 27- ALBINOWAX - http desync attacks
DEF CON 27- ALBINOWAX - http desync attacks
 
IBM dwLive, "Internet & HTTP - 잃어버린 패킷을 찾아서..."
IBM dwLive, "Internet & HTTP - 잃어버린 패킷을 찾아서..."IBM dwLive, "Internet & HTTP - 잃어버린 패킷을 찾아서..."
IBM dwLive, "Internet & HTTP - 잃어버린 패킷을 찾아서..."
 
Web Application Security 101 - 02 The Basics
Web Application Security 101 - 02 The BasicsWeb Application Security 101 - 02 The Basics
Web Application Security 101 - 02 The Basics
 
Introducing HTTP/2
Introducing HTTP/2Introducing HTTP/2
Introducing HTTP/2
 
HTTP/2 Introduction
HTTP/2 IntroductionHTTP/2 Introduction
HTTP/2 Introduction
 
Introduction to HTTP/2
Introduction to HTTP/2Introduction to HTTP/2
Introduction to HTTP/2
 
Implementing Early Hints in Chrome - Approaches and Challenges
Implementing Early Hints in Chrome - Approaches and ChallengesImplementing Early Hints in Chrome - Approaches and Challenges
Implementing Early Hints in Chrome - Approaches and Challenges
 
20190516 web security-basic
20190516 web security-basic20190516 web security-basic
20190516 web security-basic
 
Basic IT 2 (General IT Knowledge-2)
Basic IT 2 (General IT Knowledge-2)Basic IT 2 (General IT Knowledge-2)
Basic IT 2 (General IT Knowledge-2)
 
Hidden Gems in HTTP
Hidden Gems in HTTPHidden Gems in HTTP
Hidden Gems in HTTP
 

Plus de Daniel Kummer

DIY IoT - The InfoDome
DIY IoT - The InfoDomeDIY IoT - The InfoDome
DIY IoT - The InfoDomeDaniel Kummer
 
Bluetooth LE - Dodging the Bullets
Bluetooth LE - Dodging the BulletsBluetooth LE - Dodging the Bullets
Bluetooth LE - Dodging the BulletsDaniel Kummer
 
Changing internet - where we come from where we go
Changing internet - where we come from where we goChanging internet - where we come from where we go
Changing internet - where we come from where we goDaniel Kummer
 
Git - Get Ready To Use It
Git - Get Ready To Use ItGit - Get Ready To Use It
Git - Get Ready To Use ItDaniel Kummer
 
Magnolia 4.5 Migration - Storytelling
Magnolia 4.5 Migration - StorytellingMagnolia 4.5 Migration - Storytelling
Magnolia 4.5 Migration - StorytellingDaniel Kummer
 
BDD testing with cucumber
BDD testing with cucumberBDD testing with cucumber
BDD testing with cucumberDaniel Kummer
 
Git get-the-job-done
Git get-the-job-doneGit get-the-job-done
Git get-the-job-doneDaniel Kummer
 

Plus de Daniel Kummer (11)

Git code reviews
Git code reviewsGit code reviews
Git code reviews
 
DIY IoT - The InfoDome
DIY IoT - The InfoDomeDIY IoT - The InfoDome
DIY IoT - The InfoDome
 
Bluetooth LE - Dodging the Bullets
Bluetooth LE - Dodging the BulletsBluetooth LE - Dodging the Bullets
Bluetooth LE - Dodging the Bullets
 
Changing internet - where we come from where we go
Changing internet - where we come from where we goChanging internet - where we come from where we go
Changing internet - where we come from where we go
 
Git - Get Ready To Use It
Git - Get Ready To Use ItGit - Get Ready To Use It
Git - Get Ready To Use It
 
Magnolia 4.5 Migration - Storytelling
Magnolia 4.5 Migration - StorytellingMagnolia 4.5 Migration - Storytelling
Magnolia 4.5 Migration - Storytelling
 
Clean Code
Clean CodeClean Code
Clean Code
 
BDD testing with cucumber
BDD testing with cucumberBDD testing with cucumber
BDD testing with cucumber
 
Git get-the-job-done
Git get-the-job-doneGit get-the-job-done
Git get-the-job-done
 
Git
GitGit
Git
 
Git! Why? How?
Git! Why? How?Git! Why? How?
Git! Why? How?
 

Dernier

办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书zdzoqco
 
Contact Rya Baby for Call Girls New Delhi
Contact Rya Baby for Call Girls New DelhiContact Rya Baby for Call Girls New Delhi
Contact Rya Baby for Call Girls New Delhimiss dipika
 
定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一
定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一
定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一Fs
 
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012Call Girls South Delhi Delhi reach out to us at ☎ 9711199012
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012rehmti665
 
Call Girls Near The Suryaa Hotel New Delhi 9873777170
Call Girls Near The Suryaa Hotel New Delhi 9873777170Call Girls Near The Suryaa Hotel New Delhi 9873777170
Call Girls Near The Suryaa Hotel New Delhi 9873777170Sonam Pathan
 
PHP-based rendering of TYPO3 Documentation
PHP-based rendering of TYPO3 DocumentationPHP-based rendering of TYPO3 Documentation
PHP-based rendering of TYPO3 DocumentationLinaWolf1
 
Font Performance - NYC WebPerf Meetup April '24
Font Performance - NYC WebPerf Meetup April '24Font Performance - NYC WebPerf Meetup April '24
Font Performance - NYC WebPerf Meetup April '24Paul Calvano
 
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一Fs
 
Call Girls Service Adil Nagar 7001305949 Need escorts Service Pooja Vip
Call Girls Service Adil Nagar 7001305949 Need escorts Service Pooja VipCall Girls Service Adil Nagar 7001305949 Need escorts Service Pooja Vip
Call Girls Service Adil Nagar 7001305949 Need escorts Service Pooja VipCall Girls Lucknow
 
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)Dana Luther
 
Top 10 Interactive Website Design Trends in 2024.pptx
Top 10 Interactive Website Design Trends in 2024.pptxTop 10 Interactive Website Design Trends in 2024.pptx
Top 10 Interactive Website Design Trends in 2024.pptxDyna Gilbert
 
Film cover research (1).pptxsdasdasdasdasdasa
Film cover research (1).pptxsdasdasdasdasdasaFilm cover research (1).pptxsdasdasdasdasdasa
Film cover research (1).pptxsdasdasdasdasdasa494f574xmv
 
Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)Christopher H Felton
 
Git and Github workshop GDSC MLRITM
Git and Github  workshop GDSC MLRITMGit and Github  workshop GDSC MLRITM
Git and Github workshop GDSC MLRITMgdsc13
 
Magic exist by Marta Loveguard - presentation.pptx
Magic exist by Marta Loveguard - presentation.pptxMagic exist by Marta Loveguard - presentation.pptx
Magic exist by Marta Loveguard - presentation.pptxMartaLoveguard
 
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一Fs
 
Blepharitis inflammation of eyelid symptoms cause everything included along w...
Blepharitis inflammation of eyelid symptoms cause everything included along w...Blepharitis inflammation of eyelid symptoms cause everything included along w...
Blepharitis inflammation of eyelid symptoms cause everything included along w...Excelmac1
 

Dernier (20)

办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
 
Contact Rya Baby for Call Girls New Delhi
Contact Rya Baby for Call Girls New DelhiContact Rya Baby for Call Girls New Delhi
Contact Rya Baby for Call Girls New Delhi
 
定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一
定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一
定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一
 
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012Call Girls South Delhi Delhi reach out to us at ☎ 9711199012
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012
 
Call Girls Near The Suryaa Hotel New Delhi 9873777170
Call Girls Near The Suryaa Hotel New Delhi 9873777170Call Girls Near The Suryaa Hotel New Delhi 9873777170
Call Girls Near The Suryaa Hotel New Delhi 9873777170
 
PHP-based rendering of TYPO3 Documentation
PHP-based rendering of TYPO3 DocumentationPHP-based rendering of TYPO3 Documentation
PHP-based rendering of TYPO3 Documentation
 
Font Performance - NYC WebPerf Meetup April '24
Font Performance - NYC WebPerf Meetup April '24Font Performance - NYC WebPerf Meetup April '24
Font Performance - NYC WebPerf Meetup April '24
 
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一
 
Call Girls Service Adil Nagar 7001305949 Need escorts Service Pooja Vip
Call Girls Service Adil Nagar 7001305949 Need escorts Service Pooja VipCall Girls Service Adil Nagar 7001305949 Need escorts Service Pooja Vip
Call Girls Service Adil Nagar 7001305949 Need escorts Service Pooja Vip
 
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
 
Top 10 Interactive Website Design Trends in 2024.pptx
Top 10 Interactive Website Design Trends in 2024.pptxTop 10 Interactive Website Design Trends in 2024.pptx
Top 10 Interactive Website Design Trends in 2024.pptx
 
Film cover research (1).pptxsdasdasdasdasdasa
Film cover research (1).pptxsdasdasdasdasdasaFilm cover research (1).pptxsdasdasdasdasdasa
Film cover research (1).pptxsdasdasdasdasdasa
 
Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝
 
Hot Sexy call girls in Rk Puram 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in  Rk Puram 🔝 9953056974 🔝 Delhi escort ServiceHot Sexy call girls in  Rk Puram 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Rk Puram 🔝 9953056974 🔝 Delhi escort Service
 
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
 
Git and Github workshop GDSC MLRITM
Git and Github  workshop GDSC MLRITMGit and Github  workshop GDSC MLRITM
Git and Github workshop GDSC MLRITM
 
Magic exist by Marta Loveguard - presentation.pptx
Magic exist by Marta Loveguard - presentation.pptxMagic exist by Marta Loveguard - presentation.pptx
Magic exist by Marta Loveguard - presentation.pptx
 
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一
 
Model Call Girl in Jamuna Vihar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in  Jamuna Vihar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in  Jamuna Vihar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Jamuna Vihar Delhi reach out to us at 🔝9953056974🔝
 
Blepharitis inflammation of eyelid symptoms cause everything included along w...
Blepharitis inflammation of eyelid symptoms cause everything included along w...Blepharitis inflammation of eyelid symptoms cause everything included along w...
Blepharitis inflammation of eyelid symptoms cause everything included along w...
 

HTTP

  • 1. HTTP !" #$%"r$"%& '()%#'"*#+ ,-(r#"r
  • 2. A bit of History First
  • 3. 1945 – THE MEMEX SYSTEM Microfilm management 1965 – HyperText Project Xanadu 1991 – HTTP 0.9 GET only 1996 – HTTP 1.0 Headers, MIME, … 1997 – HTTP 1.1 Flaw correction 1998 – HTTP-NG stopped 2015 – HTTP/2 RFC Publish date
  • 4. What about HTTP-NG? It was planned to replace HTTP-1.1… Nah, HTTP-1.1 worked – no one wanted to adapt HTTP-NG and replace 1.1! By now we don’t need it anymore…
  • 6. The Navigator Berners-Lees’ “Biggest Mistake” <scheme>://<user>:<password>@<host>:<port> /<path>;<params>?<query>#<frag>
  • 7. URLs are 7-BIT US-ASCII
  • 8. Small and safe alphabet Readable by people always complete Encoding%20Bypasses%20limitations Reserved Characters (most of them) % / . .. # ? ; : $ , + @ & = { } | ^ [ ] ‘ < > “
  • 10. Uniform resource name stable name for an object Persistend uRL URN through URL using a resource locator server URN PURL
  • 12. Request GET / HTTP/1.1 Host: www.namics.com Accept: text/html CLIENT Server Response HTTP/1.1 200 OK Server: nginx/1.4.3 Content-Type: text/html; Content-Length: 4323 GET / HTTP/1.1 Start line Headers Body Host: www.namics.com [CRLF] Accept: text/html [CRLF] [CRLF] HTTP/1.1 200 OK Content-Type: text/html [CRLF] Server: nginx/1.4.3 [CRLF] [CRLF] <html>…</html> Plain ASCII Plain ASCII
  • 14. safe Methods No action on server GET HEAD PUT POST Patch TRACE Options Delete Message With Body Send data to server HTTP/1.1 must implement this method Inspect resource headers Deposit data on server – inverse of get Send input data for processing Partially modify a resource Echo back received message Server capabilities Delete a resource – not guaranteed
  • 16. 1xx 100-101 Informational 2xx 200-206 Successful 3xx 300-305 Redirection 4xx 400-415 Client error 5xx 500-505 Server error
  • 17. You Should know the most important ones! http://httpstatus.es Statuses are primarily for agents (Browsers) THE HTTP Protocol Version of the client DetermineS HOW IT Processes STATUS CODES!
  • 18. TRIVIA Created Response also contains a Location Header Multiple Choices Preferred URL in Location Header Request Timeout Close the connection Gone Resource one was on the server Service currently unavailable Motherfucking Snakes on the Motherfucking Plane 201 300 408 410 503 747
  • 19. Everything is Extendable You may create your own headers, methods and status codes You may not implement some methods or header logic
  • 21. Headers are about Information General Client and Server Request Client Requests Response Server Responses Entity Describe Entity body Extension Non-Standard
  • 22. GENERAL Headers Response Header from www.namics.com HTTP/1.1 200 OK Server: nginx/1.4.3 Date: Mon, 13 Oct 2014 16:18:08 GMT Transfer-Encoding: chunked Connection: keep-alive Via: 1.1 varnish Content-Type: text/html; charset=utf-8 X-Mod-Pagespeed: 1.6.29.7-3343 Vary: Accept-Encoding X-Powered-By: Secret Namics rocket technology X-Varnish: 1491545138 1491540973 Age: 1110
  • 23. Request Headers Request Header From Chrome GET / HTTP/1.1 Host: namics.com User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_5 Connection: keep-alive Accept: text/html,application/xhtml+xml,application/xml; q=0.9,image/webp,*/*;q=0.8 Accept Headers Capabilities + Preferences Accept-Encoding: gzip,deflate,sdch Accept-Language: en-US,en;q=0.8,de;q=0.6 Cookie: my_namics_SSL=1; LtpaToken=AAECAzU0M0I3RTlBNTQzQkZEMkFDTj1 q: Quality factor - Relative degree of preference
  • 24. Response Headers Response Header from www.namics.com HTTP/1.1 200 OK Date: Mon, 13 Oct 2014 16:18:08 GMT Transfer-Encoding: chunked Connection: keep-alive Server: nginx/1.4.3 Content-Type: text/html; charset=utf-8 Vary: Accept-Encoding Age: 1110 X-Mod-Pagespeed: 1.6.29.7-3343 X-Powered-By: Secret Namics rocket technology X-Varnish: 1491545138 1491540973 Via: 1.1 varnish Extension Headers Fully Custom
  • 26. - Reliable - No damaged or scrambled data! G!"r"#$%%&!
  • 27. HTTP TSL OR SSL TCP IP Network interfaces Application Layer Security Layer Transport Layer Network Layer Data Link Layer That’s Why!
  • 29. CLIENT Server COMMUNICATION Create Socket Bind socket to port 80 Accept Connections DNS Lookup Create Socket Bind Socket Connection Handshake Delay SYN SYN+ACK Read Process ACK GET / HTTP/1.1 HTTP/1.1 200 Ok Data transfer Close connection Connection properties Source IP, Source Port, Destination IP, Destination Port UNIQUE
  • 30. Performance considerations Considerable delay for small Transactions Performance depends on connection age For 1 successfully received packet, the sender can send 2 more Bundles up large amounts of tcp data for efficiency Non-full size packets can only be sent if all others are acknoleged SYN/SYN+ACK Handshake TCP Slow Start congestion control feature Nagle’s Algorithm
  • 32. The Connection Header HTTP/1.1 200 OK Connection: myheader, close Myheader: local information CLIENT Server Proxy Myheader is a hop-by-hop header and not proxied Messages are forwarded - each “Hop” must delete header fields listed in the connection header This allows protecting “local headers”
  • 33. Connection Types “Feel” faster - but still tcp performance issues 2 to 6 per client (browser) is current practice HTTP/1.0+ experimental, deprecated but still used Handled by keep-alive connection header HTTP/1.1 Re-use connections for multiple requests Active by default, explicitly close by header Only works with correct Content-Length Enqueue multiple requests over persistent connection before response arrives only for safe methods (not for “post”) Parallel Keep-Alive Persistent Pipelined
  • 34. The Keep-Alive Problem CLIENT Server GET / HTTP/1.0 Host: www.namics.com Connection: keep-alive HTTP/1.0 200 OK Connection: keep-alive Content-type: text/html Connection: keep-alive Connection: keep-alive CLIENT Dumb Proxy Server Connection: keep-alive SHOULD NOT BE PASSED Connection: keep-alive Proxy waits for connection close Connection: keep-alive Ignore request - still waiting for close
  • 35. Connection Close It can happen anytime If it happens, client should reopen and retry once for methods without side effects (Get is ok, Post is not!)
  • 36. A quick HTTP/2 Breakout Spdy Protocol
  • 37. GoogleS’ Contribution Speedy Open Networking Protocol Focus on Performance Base for HTTP/2 draft HTTP - SPDY - TCP 1 TCP Connection Multiplexing Stream priorities SSL by default Compressed headers … and more
  • 38. HANDLING STATELESSNESS Coping with the “goldfish memory”
  • 39. Enter cookies First developed by netscape Define new extension headers Cookie, Cookie2, Set-Cookie, Set-Cookie2 Flavors are session cookies and persistent cookies
  • 40. DOMAIN ATTRIBUTE CONTROLS THE “VISIBILIY” PATH ATTRIBUTE ALLOWS FINER-GRAINED CONTROL COOKIES ARE STATE INFORMATION MAINTAINED BY THE CLIENT COOKIES ARE NOT PART OF HTTP/1.1 SPECIFICATION
  • 41. VERSION 0 - NETSCAPE COOKIES Cookie: name1=value1 [; name2=value2] Set-Cookie: name=value [; expires=date] [; path=path] [; domain=domain] [; secure] Request Header Response Header
  • 42. VERSION 1 – RFC2956 COOKIES Descriptive text for cookies Forced destruction support on browser exit Max-age in relative seconds, not date Rfc6265 lists them as deprecated Controlled by Set-Cookie2 and Cookie2
  • 43. Cookies + Caching Short answer “NO”
  • 44. Cookies and Security Cookies are a security risk DNS Poisoning Cross site scripting Attacks Vulnerable To
  • 45. Cookies Alternatives HTML5 Browser storage Browser / canvas fingerprint HTTP Authentication ETAG Headers
  • 47. The evil a Javascript api to create zombie cookies https://github.com/samyk/evercookie uses every possible way to store cookies and avoid deletion FBI uses it to track TOR users Spotify uses it
  • 48. HTTP CACHING Pr"&"$%"* b. C/r#& $0% w""1 J
  • 49. Things I’Ve missed… Authorization and Security Proxies and Gateways Robots Entities and Encodings Content Negotiation 7xx status codes extension proposal …
  • 50. 418 I’m a teapot (http://tools.ietf.org/html/rfc2324)