VPN vs. proxy is the comparison between two ways of routing traffic through another server: a VPN (virtual private network) usually encrypts all of a device's internet traffic in a tunnel to a VPN server, while a proxy forwards traffic only for the apps configured to use it and doesn't necessarily encrypt it. With either one, websites see the server's IP address instead of yours.
VPN vs. Proxy at a Glance
| VPN | Proxy | |
|---|---|---|
| What it covers | All internet traffic on the device | Only apps set to use it, such as a browser or a scraper |
| Encryption | Usually encrypts traffic to the VPN server | Doesn't necessarily encrypt traffic to the proxy |
| How it works | Tunnels IP packets (for example IPsec or WireGuard) | Forwards an app's requests (for example HTTP or SOCKS5) |
| IP address sites see | The VPN server's | The proxy's |
| Who can see your traffic | The VPN provider | The proxy operator, including any unencrypted HTTP |
| IPs at the same time | One server per connection | A different proxy per app or session |
| Typical uses | Untrusted networks such as public Wi-Fi; private links between networks | Web scraping, IP rotation, geo-targeting, testing |
How a VPN Works
NIST describes a VPN as a virtual network built on top of existing networks that provides secure communication between networks or between devices. A VPN app sends the device's traffic through an encrypted tunnel to the VPN server, which forwards it to the internet. Common protocols include IPsec, which NIST calls a network-layer security control, and WireGuard, which encapsulates IP packets over UDP. The FTC notes that installing a VPN app gives it permission to intercept all of your internet traffic.
How a Proxy Works
The HTTP standard, RFC 9110, defines a proxy as a message-forwarding agent chosen by the client, usually through local configuration rules. Each app decides whether to use it: a browser through its connection settings, a script through its code.
- HTTP proxies forward web requests. For HTTPS sites, the client opens a CONNECT tunnel, and the proxy acts as a blind relay that doesn't change the messages.
- SOCKS5 proxies relay TCP and UDP traffic for any app that supports SOCKS.
- Forward proxies can hide users' IP addresses, according to MDN. Tor, for example, routes traffic through multiple proxies.
Encryption: What a VPN Adds Over HTTPS
On an HTTPS site, the connection is already protected by TLS, which is designed to prevent eavesdropping, tampering and message forgery between your device and the site. That protection passes through a proxy unchanged. A VPN adds encryption between your device and the VPN server for all traffic, including plain HTTP and non-web apps. The FTC says this typically hides the content of your traffic from your internet provider or public Wi-Fi provider. Through a proxy, plain HTTP is not encrypted, and the proxy can read or modify it.
Leaks That Can Expose Your Real IP
- DNS lookups: an app can send traffic through a SOCKS5 proxy but still resolve hostnames itself, which creates a DNS leak. In curl,
socks5h://has the proxy resolve names instead. - WebRTC: browsers expose the IP addresses WebRTC gathers to any page, so a WebRTC leak can show your real IP behind a browser proxy.
- Headers: some HTTP proxies add X-Forwarded-For, which can carry the original client IP.
Privacy and Trust in the Operator
Both a VPN and a proxy move trust from your internet provider to whoever runs the server.
- VPN encryption varies: the FTC found that some VPN apps didn't use encryption, or encrypted only part of the traffic.
- Free services: some free VPN apps share user data with third parties or redirect traffic through them, for example to serve ads. MDN notes there are likely hundreds of thousands of open forward proxies on the internet.
- Not full anonymity: a VPN doesn't make you fully anonymous. Sites you visit may be able to tell you're using one, and information you give them, such as an email address, can still identify you.
When to Use a VPN or a Proxy
- Use a VPN when you want every app's traffic encrypted on a network you don't trust, such as public Wi-Fi.
- Use a proxy when an app needs a specific IP address or location, or many addresses at once. Because the proxy is set per client, a scraping script can send each session through a different address. That is the basis of proxy pools and IP rotation.
- Speed: neither is always faster. Distance is one of the main causes of network latency, so the server's location matters for both.
Using a VPN and a Proxy Together
You can run both. The VPN tunnels the device's traffic, while proxy settings apply only to the apps that use them. With both on, an app's connection to the proxy travels inside the VPN tunnel, and the website sees the proxy's IP address. Routing through several intermediaries in a row is called a proxy chain.