DEV Community

Cover image for Proxy VS Reverse Proxy (less theory)
Md. Kawser Habib
Md. Kawser Habib

Posted on

Proxy VS Reverse Proxy (less theory)

Okay, it was a very common scenario during your university life, there were some friends who gave our attendance.

That actually means, during roll call, our friends respond on behalf of us. Simply, this is a proxy.

In Computer Science?

Things are almost similar. But need some extra explanations.

Before starting a discussion, we need to clarify 2 terms.

  1. Proxy means actually forward-proxy. So, we should always remember it.
  2. Reverse-Proxy means reverse-proxy.

Forward-Proxy aka Proxy

In the client-server model sometimes clients need to hide their identity (from the server or …).

Sometimes some governments block Facebook/Instagram/Twitter in their countries, but people somehow manage to visit these sites. In most cases, it is the proxy who plays the main role(VPN is not proxy, we will discuss it next time)

  • General Scenario: User → Facebook = Successfully Access
  • Blocked Scenario: User → Government Block →Facebook = Access Denied
  • Proxy Scenario:

Alt Text

You: Hey Proxy Server, I need to visit Facebook.
Proxy-Server: Ok, don't worry. I will communicate on behalf of you.

Your actual request(primary request) to a proxy server, inside the request there is another request(secondary-request) for the proxy server to access Facebook on behalf of you(!). So, blocakage does not work, your primary request is not for accessing Facebook. Additionally, you hide your actual IP from Facebook.

Actually, using forward-proxy, clients(users) hide their identities.

Alt Text

Reverse-Proxy

Sometimes it is necessary for a server to hide its identity (!!! Seriously)

So, when a server hides its identity, it is call reverse-proxy.

It sounds wired. But true.

This time user has no idea about the actual server. He knocks on the middleware server for any service. This server works as a broker, it knows the internal handover logic when a new request arrives. It handovers the request to the actual designated server. There will be one or multiple servers to serve the request. It is totally unknown to the users(clients), they only know the middleware(reverse-proxy) server. This way servers hide their identity from users(malicious users!!!). Besides, there are lots of very useful usages of reverse-proxy like load balancing, caching…(discuss next time)

...

Final image

Alt Text

First Published: https://khabib97.medium.com/proxy-vs-reverse-proxy-less-theory-f72988f51267

Top comments (0)