A tale of proxy server
Ahmed Shamim Hassan
Muslim ? Senior software engineer ? Laravel core contributor ? Mentor @ADPList
In a land far far away, there was a King. The king had a beautiful daughter…
Wait a minute, there must be a king and a princess to make it a fairy tale, right? And you guessed it right. There should be a country boy too. It’s a love story. Better than ‘twilight’, of course.
So, the country boy had fallen in love with the princess. The princess is soft for him too. But there is no way for the boy to contact with the princess because of the guards at the palace. But here comes the BFF of the princess to rescue. The BFF of the princess is happened to be acquainted with the boy too. So whenever the boy needs to send any message to the princess, he sent it to the BFF and she passed it to the princess. Same way the response from the princess comes back to the boy via the BFF.
I don’t know what happened next but I can only wish that something good happened and that they lived happily ever after.
So, let’s make it clear how the story is related to the topics I am going to write about.
Did you ever face a situation where you can’t access a site from your educational institute/home/office because it is blocked or you don’t have access to the network outside you are working? Or you wanted to see a YouTube video but can’t because it is unavailable in your country?? What did you do next? If you are clever you might have used some application called ‘proxy’ which bypasses all these restrictions and gets you the content you want. Yup! that’s right, you are the ‘boy’, this proxy is the ‘BFF’ of our princess and the site is the ‘princess’ whom we wanted to contact.
Simply speaking, a ‘proxy server’ is a go-between or intermediary between you and your origin server. Generally, when you browse a site or a service, your PC/device sends a request to the origin server which hosts the site/service and sends you back the content you wanted. But in terms of a proxy, you send the request to the ‘proxy server’, it gets your request which lets it know which server you want to contact, then it contacts the origin Server, gets the content, and sends it back to you. Simple as that.
In general, there are two types of proxy servers, which are known as:
In the ‘forward proxy server’, the origin server doesn’t know who the actual ‘requestee’ is. The server assumes that the ‘proxy server’ is the actual requestee, so it sends back the response to it, and then the proxy server returns the same response to the actual requestee(that means you).
On the other hand, ‘reverse proxy’ is kind of the inverse of the ‘forward proxy’. In that case, think that the main server is secured behind a protected network, and you can’t directly contact it. You wouldn’t know where it is actually. You can only access to a proxy server, in this case, it is known as a ‘reverse proxy server’, and the proxy server will connect with the actual server to get you the content. You/client would assume that the proxy server is the ‘origin server’.
Do you need a single-line simple explanation?
领英推荐
Here it goes:
Now, what would be some of the uses for forward and reverse proxies? (collected from here)
Forward proxy server
Reverse proxy server
That’s it. Hopefully, you got an overview of the concept.
The following links have some nice explanations and descriptions about proxy servers.
Previously published on my blog: https://ahmedshamim.com/posts/a-tale-of-proxy-server
Frontend Web Developer | Expert in HTML, CSS, JavaScript, jQuery, React.js, Vue.js, PHP | Skilled in Tailwind CSS, Bootstrap | Git & GitHub Enthusiast | WordPress Specialist with Elementor & WooCommerce Mastery.
1 年Great article, Ahmed Shamim Hassan! Your clear explanation really helps in understanding the difference between 'forward proxy' and 'reverse proxy' servers. Keep up the informative content!
Studying Hard
1 年Thanks for the insight on proxy in such a way. ??