Skip to main content

Command Palette

Search for a command to run...

🧩 Proxy Server – Simplified and Explained

Published
β€’5 min readβ€’View as Markdown

🍫 The Chocolate Example (Simple Analogy)

A small child wants a chocolate 🍫.
Instead of going directly to the shop, the child tells the mother,
and the mother goes to the shopkeeper to buy it.

  • Child β†’ Mom β†’ Shopkeeper β†’ Mom β†’ Child

    • Child = Client

    • Mom = Proxy Server

    • Shopkeeper = Actual Server

➑️ The client (child) never directly communicates with the server (shopkeeper).
➑️ The proxy acts as a middleman, handling requests and responses.


🧠 What is a Proxy Server?

A proxy server acts as an intermediary between the client and the destination server.

It:

  • Forwards client requests to other servers.

  • Can hide the client's real identity (IP address).

  • May cache, filter, or log traffic.

  • Can improve security, anonymity, and performance.


πŸ—οΈ Types of Proxy Servers

1️⃣ Forward Proxy (a.k.a. Simple Proxy)

  • Used by clients to access external resources.

  • Hides the client's IP address from the server.

  • Commonly used inside corporate or school networks.

Example:

In an office, all employees access the internet through a forward proxy.
If 5 employees request google.com, the proxy may cache the first response and reuse it for others.

How it works:

Client β†’ Forward Proxy β†’ Internet β†’ Target Server

Server sees request from: Proxy's IP, not client's.

βœ… Advantages of Forward Proxy

FeatureDescription
πŸ”’ AnonymityHides client identity
⚑ CachingReduces bandwidth by caching popular content
🚫 Access ControlBlocks or filters specific sites
πŸ” SecurityCentral point for malware or content scanning
🌍 Bypass RestrictionAllows access to restricted or region-locked content

❌ Disadvantages

LimitationDescription
βš™οΈ App SpecificMust be configured per application (e.g., browser proxy settings)
🧱 Single Point FailureIf proxy fails, all traffic may stop
πŸ•’ DelayAdds latency if not optimized
πŸ” Partial SecurityDoesn’t encrypt by default (unlike VPNs)

2️⃣ Reverse Proxy

  • Used by servers to protect backend servers.

  • Client sends requests to reverse proxy; it decides which actual server handles it.

  • Protects server identity and adds load balancing, caching, and security.

Example:

If you visit www.netflix.com, your request goes to a CDN (Content Delivery Network),
which acts as a reverse proxy and serves cached content from the nearest location.

How it works:

Client β†’ Reverse Proxy β†’ Internal Servers (Server1, Server2, Server3)

Client sees only the reverse proxy, not the actual servers.


βœ… Advantages of Reverse Proxy

FeatureDescription
πŸ›‘οΈ SecurityHides backend server IPs
⚑ CachingReduces load and improves response speed
πŸ“¦ Load BalancingDistributes traffic across multiple servers
🌍 CDN IntegrationProvides faster content delivery globally
πŸ” SSL TerminationHandles HTTPS encryption centrally

πŸ“Š Comparison: Forward vs Reverse Proxy

FeatureForward ProxyReverse Proxy
Acts on behalf ofClientServer
Hides IP ofClientServer
Common Use CaseInternet access, anonymityLoad balancing, CDN, security
ExampleCorporate proxy, school proxyNginx, Cloudflare, AWS CloudFront
DirectionClient β†’ Proxy β†’ InternetInternet β†’ Proxy β†’ Server

🌐 Proxy vs VPN

FeatureProxyVPN
ScopeApplication-levelSystem-level
EncryptionUsually noneFull encryption tunnel
AnonymityHides IP onlyHides IP + Encrypts all data
Use CaseAccess blocked sites, cachingSecure remote access, privacy
ExampleWeb browser proxyNordVPN, ExpressVPN

Analogy:

  • Proxy = Mask πŸ•ΆοΈ (hides your face)

  • VPN = Mask + Private Tunnel πŸš‡ (hides your face and encrypts your path)


βš–οΈ Proxy vs Load Balancer

FeatureProxyLoad Balancer
Primary FunctionMediate and filter requestsDistribute traffic evenly
Acts AsMiddle layer between client and serverDispatcher for backend servers
TypeForward or ReverseAlways Reverse
Can it be both?Reverse proxy can act as a load balancerLoad balancer cannot act as a proxy
ExampleSquid ProxyAWS ELB, Nginx load balancing

Note:
If only one server exists β€” no need for a load balancer,
but a proxy can still provide security, caching, and logging.


πŸ”₯ Proxy vs Firewall

FeatureProxyFirewall
Works onApplication layerNetwork layer (packet level)
PurposeHide IP, filter requests, cacheBlock/allow network packets based on rules
FunctionActs as middlemanGuards entry/exit points
ExampleSquid, NginxpfSense, Cisco Firewall

Simplified view:

Firewall = Security Guard (checks who enters)
Proxy = Receptionist (forwards requests, keeps log)

🧭 Diagram Summary

Forward Proxy Diagram

[ Client ] ---> [ Forward Proxy ] ---> [ Server ]

Reverse Proxy Diagram

[ Client ] ---> [ Reverse Proxy ] ---> [ Server1 ]
                                     β”œβ”€β”€> [ Server2 ]
                                     └──> [ Server3 ]

Combined Security Architecture

[ Client ] ---> [ Firewall ] ---> [ Proxy (Forward/Reverse) ] ---> [ Load Balancer ] ---> [ Servers ]

πŸ’‘ Summary Points

  • Forward Proxy = Protects client identity.

  • Reverse Proxy = Protects and optimizes server performance.

  • VPN = Encrypts everything end-to-end.

  • Load Balancer = Manages traffic between multiple servers.

  • Firewall = Defines which packets can enter or exit the system.