

The IP address alone will allow the HTTP message to arrive at the right machine, but you still need the port number in order for the HTTP request to arrive exactly at the web server. mail is handled by 1 .Īs you can see, the DNS will translate to any of the addresses above.

Well, this domain name is converted into an IP address through a large distributed database called the DNS.ĭo you want to check out what this IP address is?Įasy! Head to your terminal and do the following: $ host So where is that address when all you did was type your browser? I will try to keep it simple but if you are interested in improving your knowledge of networking concepts, I highly recommend this book by Ross and Kurose. I know all these acronyms (TCP, IP, etc.) might be overwhelming if your networking concepts are not strong. In order to reach its destination, each http message carries an address called the destination TCP address.Īnd each TCP address is composed of an IP address and a port number.
SIMPLE DESKTOPS ANCHORS HOW TO
The TCP Socket AddressĪny http message (whether it is a request or response) needs to know how to reach its destination. Let me explain how, but again….at a high level. In fact this is one of my favorite questions that I ask potential candidates in a coding interview. This web server is responsible for intercepting these requests and handling them appropriately.Īlright, now that you know what a web server is and what its function is exactly, you might be wondering how does the request reach that yahoo machine in the first place?
SIMPLE DESKTOPS ANCHORS SOFTWARE
To reiterate, the machine that receives the http request has a software process called a web server running on it. This web server will intercept your request, and handle it by responding back with the html of the Yahoo home page.įinally your browser renders this html on the screen and that’s what you see on your screen.Įvery interaction with the Yahoo home page after that (for example, when you click on a link) initiates a new request and response exactly like the first one. This Request will travel all the way to a Yahoo computer that has a web server running on it. Of course you are going to get the Yahoo home page rendered on your browser window.īut what really just happened under the hood?Īctually a lot of things have happened and I might dedicate a whole article to explain the magic behind how this happened.īut for the sake of simplicity, I will abstract away some of the details and talk about this at a very high level.Īt a high level, when you type your browser, your browser will create a network message called an HTTP request.


Imagine you pull up your Chrome browser and type in the address bar. If you already know how web servers work, then you can skip directly to this section.Īn HTTP web server is nothing but a process that is running on your machine and does exactly two things:ġ- Listens for incoming http requests on a specific TCP socket address (IP address and a port number which I will talk about later)Ģ- Handles this request and sends a response back to the user. In this article, I will cover how to create the most basic http web server in Python.īut because I want to make sure you understand what we are building, I am going to give an overview first about what web servers are and how they work. Or may be you are just configuring a web server for your website. May be you are building an API server for a backend service. No matter what type of software engineer you are, at some point in your career you will have to interact with web servers. Heck you are interacting with one right now!
