Networking

Proxy vs VPN: What's the Difference and Which Should You Use?

A proxy relays traffic for one app or protocol, usually a browser, and normally adds no encryption of its own. A VPN creates an encrypted tunnel for all of a device's traffic at the network level, so every app's connections leave from the VPN server and nothing between you and that server can read them.

Both change the IP address the destination sees. The difference is how much traffic they cover and whether the path to the server is protected.

Proxy (HTTP or SOCKS)VPN (WireGuard, IPsec)
What it coversApps configured to use itAll traffic from the device, or chosen routes
Where it worksApplication levelNetwork level (IP packets)
Encryption to the serverNone by default; only what the app already uses (HTTPS)Yes, always
Hides traffic from local Wi-Fi and ISPNo (except HTTPS content, which was already hidden)Yes, apart from the fact you are connected to a VPN
SetupAn address and port in app or OS settingsClient app or OS VPN profile with keys or credentials
Typical usesCompany web filtering, scraping, testing from another IP, cachingUntrusted Wi-Fi, remote access to a private network, region changes

What a proxy is

HTTP's own specification defines a proxy as "a message-forwarding agent that is chosen by the client, usually via local configuration rules". Your app sends its request to the proxy, and the proxy makes the request to the real server on your behalf. The server sees the proxy's IP address, not yours.

Three kinds are common:

  • HTTP proxy. Handles web requests. For HTTPS sites, the browser sends a CONNECT request, which RFC 9110 describes as asking the proxy to "establish a tunnel to the destination origin server". From then on the proxy only relays encrypted bytes: it sees which host and port you connect to, but not the pages or data.
  • SOCKS5 proxy. A lower-level relay defined in RFC 1928 for "client-server applications in both the TCP and UDP domains", conventionally on TCP port 1080. It doesn't understand HTTP, so it works with any protocol the app supports, such as SSH or game traffic.
  • Reverse proxy. Sits in front of servers, not clients. RFC 9110 calls it a gateway that "acts as an origin server for the outbound connection". Load balancers and CDNs are reverse proxies. This is a server-side tool and not an alternative to a VPN.

The important limit: a proxy only carries traffic from apps that are told to use it. Set one in Firefox and your mail client, game launcher and system updates still go out directly.

What a VPN is

A VPN client creates a virtual network interface on your device. The operating system routes IP packets into it, the client encrypts them, and sends them to the VPN server, which decrypts them and forwards them to the internet. WireGuard describes its design in one line: it "securely encapsulates IP packets over UDP". IPsec, the subject of NIST's Guide to IPsec VPNs, does the same job at the network layer and is what many corporate and built-in OS VPNs use.

Because it works on packets rather than on one app's requests, a VPN covers every program on the device without configuring each one. Your local network and ISP see only encrypted traffic to the VPN server. The destination sees the VPN server's IP address.

A VPN also works in the other direction, which a proxy can't: it can put your laptop "inside" a private network, so you can reach file shares, databases or internal sites at private IP addresses from home. That is the original purpose of corporate VPNs.

Who can see what

The clearest way to compare them is to list what each party learns when you open an HTTPS website.

ObserverNo proxy, no VPNThrough a proxyThrough a VPN
Local Wi-Fi / ISPSite hostnames (from your DNS lookups) and traffic volume; page content is encrypted by HTTPSThat you talk to the proxy, and usually the hostname in the CONNECT request (plain HTTP proxies are unencrypted)Only that you are connected to the VPN server
Proxy or VPN operatorNot involvedHostnames you visit; full content of any non-HTTPS trafficHostnames and IPs you visit; full content of any non-HTTPS traffic
The websiteYour IP addressThe proxy's IP addressThe VPN server's IP address

Two points follow from this table. First, HTTPS already protects page content in all three cases; what a VPN adds is hiding where you go from your local network. Second, neither tool removes trust, it moves it: the proxy or VPN operator sits where your ISP used to.

DNS: the detail that leaks

Before connecting to a site, your device looks up its IP address with DNS. With a full-tunnel VPN, DNS queries are IP packets like any other, so they travel through the tunnel unless the client sends them elsewhere. With a proxy, it depends on the setting. curl's documentation shows the difference for SOCKS5: the socks5h:// prefix makes the proxy resolve the hostname, while plain socks5:// resolves it on your own machine, so your local DNS server still sees every site name.

curl -x socks5h://127.0.0.1:1080 https://example.com/
curl -x socks5://127.0.0.1:1080 https://example.com/

How to tell what your computer is using

On Windows, the proxy for browsers and most apps is set in Settings > Network & internet > Proxy, either "Automatically detect settings" or a manual address and port. To read the current values from PowerShell without changing anything:

Get-ItemProperty 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings' |
  Select-Object ProxyEnable, ProxyServer, AutoConfigURL
netsh winhttp show proxy

Example output on a PC with no proxy:

ProxyEnable   : 0
ProxyServer   :
AutoConfigURL :

Current WinHTTP proxy settings:

    Direct access (no proxy server).

The first command reads the current user's Internet Settings key, where ProxyEnable : 0 means no manual proxy is switched on. netsh winhttp show proxy reports WinHTTP's own proxy setting, which is configured separately. VPN connections are under Settings > Network & internet > VPN, or in the VPN provider's own app.

Command-line tools often ignore the system setting and read environment variables instead. curl uses http_proxy (lower case only), HTTPS_PROXY and ALL_PROXY, and skips hosts listed in NO_PROXY. If curl behaves differently from your browser, check these with env | grep -i proxy on macOS and Linux, or Get-ChildItem Env: | Where-Object Name -like '*proxy*' in PowerShell.

Which one should you use?

  • Public or hotel Wi-Fi: a VPN. It covers every app, and the local network sees nothing but the tunnel.
  • Reaching work systems from home: your organisation's VPN. A proxy can't put you on a private network.
  • Your employer or school requires a proxy: use their proxy settings; it is usually there for filtering, caching or logging, and the network may not work without it.
  • One script or browser profile from a different IP: a proxy is lighter and leaves the rest of the machine untouched.
  • Testing how a site looks from another country: either works; a browser-only proxy keeps the rest of your traffic local.
  • Privacy from the sites themselves: neither is enough on its own. Logins, cookies and browser fingerprints identify you whatever your IP address.

If something stops working

If sites stop loading after you set a proxy, check the address and port first, then whether the proxy needs a username and password. Test it outside the browser with curl -v -x http://proxy.example:8080 https://example.com/: the verbose output shows whether the connection to the proxy or the tunnel through it fails. If a VPN connects but nothing loads, compare ping 1.1.1.1 with ping example.com; if the IP address answers and the name does not, DNS over the tunnel is the problem. If devices on your home network, such as a printer, become unreachable while the VPN is on, the VPN is routing local traffic into the tunnel; look for a split-tunnel or local network setting in the VPN client.

Frequently asked questions

Is a proxy safer than a VPN?
No. A typical HTTP or SOCKS proxy adds no encryption of its own, so its only protection for your data is whatever the app already uses, such as HTTPS. A VPN encrypts everything between your device and the VPN server. Both hand your traffic to whoever runs the server, so the operator's trustworthiness matters in either case.
Does a VPN make me anonymous?
No. A VPN hides your IP address from the sites you visit and hides your traffic from your local network and ISP. The VPN provider can still see which servers you connect to, and sites can still identify you through logins, cookies and browser fingerprinting.
Can I use a proxy and a VPN at the same time?
Yes. With the VPN connected, an app configured to use a proxy sends its traffic through the VPN tunnel to the proxy. Microsoft notes that if a VPN connection itself needs a proxy, it has to be set up separately in that VPN connection's settings.
Is a free proxy or free VPN safe to use?
Treat it with caution. Whoever runs the server can see your traffic metadata, and for unencrypted connections, the content. Someone pays for the servers and bandwidth, so ask how a free service makes money before sending anything sensitive through it.

Sources