Week 03 - Web Protocols
Week 03 - Web Protocols
<a name="top_of_page"></a>
...
● Request-response
protocol
Omnilinks, a solution that embraces all the previously mentioned deep linking options
along with an index and an API. Omnilinks are very similar to App Indexing ones, but are
targeting all major mobile OSes.
https://www.infoq.com/news/2014/10/urx-deep-links/
www.someSchool.edu:8080/someDept/pic.gif
• URL components
– Server hostname
– (Optional port number)
– Path name
CS 312 - Internet Concepts / Weigle 11
URI Components
foo://username:[email protected]:8042/over/there/index.dtb;type=animal?name=ferret#nose
\ / \________________/\_________/ \__/ \___/ \_/ \_________/ \_________/ \__/
| | | | | | | | |
| userinfo hostname port | | parameter query fragment
| \_______________________________/ \_____________|____|____________/
scheme | | | |
| authority |path|
| | |
| path interpretable as filename
| ___________|____________ |
/ \ / \ |
urn:example:animal:ferret:nose interpretable as extension
Other examples:
• http://example.org/absolute/path/to/resource.txt
• ftp://example.org/resource.txt
• urn:issn:1535-3613
Figure source: Uniform Resource Identifier (Wikipedia)
CS 312 - Internet Concepts / Weigle 12
Outline
• Hypertext Transfer Protocol (HTTP)
• Request/Response Formats
• Security: HTTPS, TLS
• Caching
• Web Developer Tools
From https://www.cs.odu.edu/~mweigle/CS455-S13/Sched?action=download&upname=2-2-HTTP.pdf
CS 312 - Internet Concepts / Weigle 14
HTTP Response Format
From https://www.cs.odu.edu/~mweigle/CS455-S13/Sched?action=download&upname=2-2-HTTP.pdf
CS 312 - Internet Concepts / Weigle 15
Example HTTP Request, Response
Requesting http://www.harding.edu/comp/
Client Request
GET /comp/ HTTP/1.1
Host: www.harding.edu
Server Response
HTTP/1.1 200 OK
Content-Length: 6018
Content-Type: text/html
Content-Location: http://www.harding.edu/comp/
Last-Modified: Mon, 05 Jul 2010 18:49:40 GMT
Server: Microsoft-IIS/6.0
Potentially many
requests & responses
Client (Web Browser) Web Server (foo.org) 1.2.3.4
CS 312 - Internet Concepts / Weigle 19
Building Up a Webpage
Server Response
HTTP/1.1 200 OK
Content-Length: 6018
Content-Type: text/html
Content-Location: http://www.harding.edu/comp/
Last-Modified: Mon, 05 Jul 2010 18:49:40 GMT
Server: Microsoft-IIS/6.0
• Protocol steps
– Certificate authentication (usually
server auth only)
– Encryption key registration
– Encryption/decryption of message
• Disadvantages
– computationally expensive, due to
encryption/decryption
– $$ expensive, requires servers to
have certificates from trusted
certificate authorities (CAs)
source: WebPageTest
CS 312 - Internet Concepts / Weigle 47
Talking to HTTP servers…
% curl --head https://www.cs.odu.edu/~mweigle/
HTTP/1.1 200 OK
Server: nginx
Date: Fri, 03 Jan 2020 18:12:10 GMT
Content-Type: text/html; charset=ISO-8859-1;
Connection: keep-alive
Expires: Tue, 01 Jan 2002 00:00:00 GMT https://curl.haxx.se/docs/manpage.html
Cache-Control: no-store, no-cache, must-revalidate
Front-End-Https: on
% curl -I http://www.google.com/
HTTP/1.1 200 OK
Cache-Control: private, max-age=0
Date: Mon, 12 Jan 2009 15:45:57 GMT
Expires: -1
Content-Type: text/html; charset=ISO-8859-1
Set-Cookie: PREF=ID=9a80d3f602b685f3:TM=1231775157:LM=1231775157:S=imGxRyNsTD0Zczm5;
expires=Wed, 12-Jan-2011 15:45:57 GMT; path=/; domain=.google.com
Server: gws
Content-Length: 0
CS 312 - Internet Concepts / Weigle 48
more curl…
% curl https://www.cs.odu.edu/~mweigle/
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!--<html xmlns="http://www.w3.org/1999/xhtml" $GmaIEFix>-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Home | Michele C. Weigle </title>
<meta http-equiv='Content-Style-Type' content='text/css' />
...
% curl -i https://www.cs.odu.edu/~mweigle/
HTTP/1.1 200 OK
Server: nginx
Date: Fri, 03 Jan 2020 18:11:04 GMT
Content-Type: text/html; charset=ISO-8859-1;
Transfer-Encoding: chunked
Connection: keep-alive
Expires: Tue, 01 Jan 2002 00:00:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Vary: Accept-Encoding
Front-End-Https: on
<!DOCTYPE html
...
<!doctype html>
<html>
...
Connection closed by foreign host.
HTTP/1.1 200 OK
Content-Encoding: gzip
Accept-Ranges: bytes
Cache-Control: max-age=604800
Content-Type: text/html; charset=UTF-8
Date: Fri, 03 Jan 2020 18:39:17 GMT
Etag: "3147526947+gzip"
Expires: Fri, 10 Jan 2020 18:39:17 GMT
Last-Modified: Thu, 17 Oct 2019 07:18:26 GMT
Server: ECS (dcb/7EEF)
X-Cache: HIT
Content-Length: 648
Connection: close
HTTP/1.1 200 OK
Allow: OPTIONS, GET, HEAD, POST
Cache-Control: max-age=604800
Content-Type: text/html; charset=UTF-8
Date: Fri, 03 Jan 2020 18:41:43 GMT
Expires: Fri, 10 Jan 2020 18:41:43 GMT
Server: EOS (vny006/044E)
Content-Length: 0
Connection: close
15d
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>501 - Not Implemented</title>
</head>
<body>
<h1>501 - Not Implemented</h1>
</body>
</html>
possible!
date: Fri, 03 Jan 2020 19:09:53 GMT
expires: Fri, 03 Jan 2020 19:14:53 GMT
location: http://bit.ly/2QIY1jW
server: tsa_a
set-cookie: muc=d8cec1cd-a7d1-40db-8d76-737b85d13f08; Max-Age=63072000; Expires=Sun, 2 Jan 2022 19:09:53 GMT;
Domain=t.co
strict-transport-security: max-age=0
vary: Origin
x-connection-hash: fc0224ab9bcbfa6261c63e01389c5472
x-response-time: 8
HTTP/1.1 200 OK
Date: Fri, 03 Jan 2020 19:09:53 GMT
Server: Apache/2.4.6 (Red Hat Enterprise Linux)
Vary: Host
Accept-Ranges: bytes
Connection: close
Content-Type: text/html; charset=UTF-8
Set-Cookie: BIGipServerWEB_HTTPS_PROD.app~WEB_HTTPS_PROD_pool_campus=rd627o00000000000000000000ffff8052619fo80;
path=/; CS 312 - Internet Concepts / Weigle 59
302 - Found
% curl -I https://dx.doi.org/10.1145/1998076.1998100
HTTP/2 302
date: Wed, 09 Sep 2020 21:54:18 GMT
content-type: text/html;charset=utf-8
content-length: 195
set-cookie: __cfduid=df8601cbe1c37abae1beb49becc95d4ac1599688458;
expires=Fri, 09-Oct-20 21:54:18 GMT; path=/; domain=.doi.org; HttpOnly;
SameSite=Lax; Secure
vary: Accept
location: http://portal.acm.org/citation.cfm?doid=1998076.1998100
expires: Wed, 09 Sep 2020 22:32:29 GMT
cf-cache-status: DYNAMIC
cf-request-id: 051675da7a0000255023bec200000001
expect-ct: max-age=604800,
report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
strict-transport-security: max-age=31536000; includeSubDomains; preload
server: cloudflare
cf-ray: 5d0425a3f83e2550-IAD