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)

Breakdown of connection to server

  1. User enters http://someschool.edu/somedepartment/home.index in the address bar of a browser
  2. The browser (ie. HTTP client process) initiates a TCP connection to the server www.someschool.edu at port 80
    • associated with the TCP connection, there will be a socket at the client and a socket at the server.
  3. The browser sends an HTTP request to the server via its socket.
    • The request includes the path name /somedepartment/home.index
  4. 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.
  5. 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.
  6. The browser receives the response, and the TCP connection is closed.
  7. 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.
  8. 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.

Children
  1. CORS
  2. ETag
  3. HTTP Methods
  4. URL
  5. Webdav

Backlinks