Clients and Servers
We have seen how web browsers make requests, and web servers return data. * The browser knows how to read the data and display it as an HTML page.

This is an example of the client-server model.
Client-Server Model¶
Clients request data from a resource or service.
Servers are the locations of those resources or services.
The transfer of data, initiated by the client, is called the request-response cycle.

- Client initiates a request.
- Server processes (handles) the request.
- Server returns a response.
The client and server are programs running on a host.
Host vs. Server¶
A host is a device connected to a network.
* It has an address, such as an IP (Internet Protocol) address like 86.75.30.9.
* A host could be a server, client, or both.

Practice Exercise¶
In conversation, when we refer to a "server" we are often describing a remote computer that is both a host (connected to a network) and server (accepts requests from clients).
Though server and host are often used interchangeably, know that a host is a computer connected to a network - a physical device - and a server accepts requests.
Localhost¶
In networking, localhost is the name for "this computer."
The name localhost is used by a client (like a web browser) on your computer to access resources from a server running on your computer.
Practice Exercise¶
The name localhost usually resolves to the IP address 127.0.0.1.