HTTP
HTTP uses TCP as its underlying transport protocol.
- The HTTP client first initiates a TCP connection with the server, then once the connection is made, the browser and server processes access TCP through their socket (Private) interfaces.
Credentials policy
Only relevant to browsers
- Credentials are cookies, authorization headers or TLS client certificates.
Credentials
-
include
- send a request with credentials included, even if it's cross-origin -
same-origin
- only send credentials if the request URL is on same origin as the calling script -
omit
- ensure browsers don’t include credentials in the request -
we can use the
Access-Control-Allow-Credentials
response header to tell browsers to expose the response to frontend JavaScript code.- to do this, the client will need to set the credentials to
include
(Request.credentials
)
- to do this, the client will need to set the credentials to
Breakdown of connection to server
- User enters
http://someschool.edu/somedepartment/home.index
in the address bar of a browser - The browser (ie. HTTP client process) initiates a TCP connection to the server
www.someschool.edu
at port80
- associated with the TCP connection, there will be a socket at the client and a socket at the server.
- The browser sends an HTTP request to the server via its socket.
- The request includes the path name
/somedepartment/home.index
- The request includes the path name
- The server receives the request and retrieves the object (in this case, HTML) from its storage (eg. RAM or disk), encapsulates the object in an HTTP response, then sends that message to the client via its socket.
- The HTTP server process tells TCP to gracefully close the TCP connection.
- "gracefully" here means that the connection will only close once the client receives the full communication.
- The browser receives the response, and the TCP connection is closed.
- The response from the server indicates that the encapsulated object is HTML. The client then extracts the file fromm the response message, examines the HTML file, and finds references to 10 JPEG objects.
- Steps 1-5 are then repeated for each of the referenced JPEG objects.
- These 10 TCP connections are most likely made in parallel, which we would say are 10 serial TCP connections.
- This degree of parallelism is determined by the browser, and configurable by the user.
- by default most browsers open between 5 and 10 parallel TCP connections.
- This degree of parallelism is determined by the browser, and configurable by the user.
- These 10 TCP connections are most likely made in parallel, which we would say are 10 serial TCP connections.
Children
Backlinks