What Is a Proxy Server and How Does It Work
Tech one Computer Science Cyber Security Information Security

What Is a Proxy Server and How Does It Work?

Run curl https://api.ipify.org on a laptop and the response is the IP address your ISP assigned. Add -x http://198.51.100.25:3128 and the response becomes 198.51.100.25. Nothing on the laptop changed. Another machine, the proxy server, opened the connection, and its address is the one the server logged.

That substitution is what a proxy server is and how it works. Most proxy problems, from DNS leaks and 407 loops to bandwidth bills twice the estimate, come from not knowing which machine does what at each step.

What Is a Proxy Server?

A proxy server is an intermediary that accepts a client’s request, opens its own connection to the destination and relays the response back. The destination sees the proxy server’s IP address instead of the client’s. The same machine can also authenticate users, filter or cache content, keep logs and rewrite headers.

Related Articles:

How Does a Proxy Server Work?

Here is the common case: an HTTPS request for example.com through a forward proxy server at 198.51.100.25:3128 (Squid’s default port; 8080 is also common, and 1080 is standard for SOCKS):

  1. The client opens a TCP connection to the proxy server. It never contacts example.com.
  2. It sends CONNECT example.com:443 HTTP/1.1, with a Proxy-Authorization header if the proxy requires a login.
  3. The proxy server checks the credentials (or the client’s IP against an allowlist), resolves example.com with its own DNS and connects from its own address.
  4. It replies 200 Connection established and from then on only copies bytes in both directions.
  5. The client runs the TLS handshake with example.com inside that tunnel. The proxy sees the hostname, port, byte counts and timing, but not URLs, headers, cookies or bodies.
  6. The access log on example.com records 198.51.100.25 as the client.
Proxy Network Sequence Diagram
HTTPS through a forward proxy: the origin only ever talks to 198.51.100.25

Plain HTTP is different. The client sends the full URL (GET http://example.com/page HTTP/1.1), and the proxy can read, cache or rewrite everything, including adding Via or X-Forwarded-For. Corporate gateways such as Zscaler or Squid with ssl-bump inspect HTTPS only because the company installs its own root certificate on managed devices.

HTTP Proxies vs SOCKS5

An HTTP proxy understands HTTP, so it can cache, filter by URL and add headers. SOCKS5 (RFC 1928, 1996) works a layer lower: it relays any TCP stream, and UDP through its UDP ASSOCIATE command, without parsing the application protocol. Its password method, RFC 1929, sends credentials in cleartext, and Chrome never implemented it. Chrome’s SOCKS5 client offers only “no authentication”, so a SOCKS5 proxy used from Chrome needs IP allowlisting.

DNS is the usual trap. In curl and Python’s requests, socks5:// resolves the hostname locally and socks5h:// lets the proxy server resolve it, while httpx and Go’s net/http send the hostname with either scheme. Local resolution exposes every hostname to your ISP’s resolver, and geo-aware DNS may return a CDN edge near you rather than near the proxy.

What the Extra Hop Costs

Call the client-to-proxy round trip p and the proxy-to-target round trip o. A new HTTPS connection through an HTTP proxy costs about 4p + 3o: TCP to the proxy, CONNECT (which waits for the proxy’s handshake with the target), TLS and the request. SOCKS5 adds one more round trip to the proxy, SOCKS5 with a password two. A reused connection costs p + o.

On a Proxys.io test bench running Squid 6.14 with p = 40 ms and o = 80 ms, the formula predicted 400 ms and curl measured 411 ms. The proxy server itself added under 0.1 ms per request on an open connection, so the cost is almost entirely network. Two rules follow. Place the exit near the target. And reuse connections, because a rotating proxy that switches IP on every request pays the full 4p + 3o each time.

The formula also shows where the cheapest milliseconds are. p is counted four times and o three, so shortening the client’s leg pays off fastest: the same request sent from a VPS in the proxy’s region, with p around 5 ms, comes to about 260 ms instead of 400. It’s one reason scheduled jobs tend to run on a server near their exits rather than from an office laptop.

Types of proxy servers

Forward and Reverse Proxies

A forward proxy acts for clients: an office’s Squid egress, or a proxy rented from a provider. A reverse proxy acts for servers. Nginx, HAProxy or Cloudflare in front of an application terminate TLS, balance load and cache static files, and visitors rarely know it’s there.

Forward vs. Reverse Proxy Architecture
Forward vs. Reverse Proxy Architecture

Transparent, Anonymous and Elite Proxies

These labels describe headers. A transparent proxy forwards your IP in X-Forwarded-For, which is why schools and ISPs use them for filtering. An anonymous proxy hides your IP but announces itself through Via. An elite proxy adds nothing.

Inside a CONNECT tunnel, though, the proxy can’t add headers at all, because the exchange is encrypted. For HTTPS, the reputation and registration of the exit IP decide how “anonymous” a proxy looks.

Datacenter, ISP, Residential and Mobile Proxies

This split is about who the exit IP is registered to. Datacenter proxy servers use hosting-company addresses: fast, cheap, billed per IP and easy to identify by ASN. ISP (static residential) proxies are registered to consumer ISPs but run on servers. A residential proxy exits through a household device that reputable networks enroll via consent-based apps or SDKs; it’s billed per GB and rotates as devices come and go. Mobile proxies exit through carrier networks, where carrier-grade NAT puts many subscribers behind one public IP. Sites hesitate to block such addresses, and that trust makes mobile the most expensive tier.

IPv6 is the budget tier. Proxys.io lists individual IPv6 from $0.13 a month at volume, under a tenth of its $1.47 entry price for dedicated IPv4. The catch: an IPv6 exit reaches only sites with AAAA records, and W3Techs counted IPv6 on 30.7% of websites in July 2026.

What Proxy Servers Are Used For

Companies run forward proxies to enforce acceptable-use policy, log egress for audits and cache downloads, so 500 laptops pulling one OS update fetch it once. Teams rent proxy servers for location checks: storefront prices and tax in Germany, ad rendering in the markets the ads were bought for, local search rankings.

A fixed egress IP is a less obvious use. Partner APIs and payment gateways often allowlist client IPs, and AWS Lambda usually gets a stable one through a NAT gateway, at $0.045 an hour (about $32.85 a month) plus $0.045 per GB in us-east-1. A static proxy costs a few dollars a month, though it puts a third party on the path, so regulated data usually belongs inside your own AWS account.

More IPs don’t change what a site permits. Terms of service, robots.txt and published API rate limits apply however many exits you hold.

Common Proxy Server Errors and How to Fix Them

First find who sent the error. 407, 502 and 504 come from the proxy server; 403 and 429 usually come from the target. curl -v shows whether the failure happened during CONNECT or after the TLS handshake.

Symptom Sent by Usual cause First fix
407 Proxy Authentication Required Proxy server Wrong login, IP not allowlisted, or @, : or # unencoded in the password Percent-encode (@ becomes %40); allowlist your current IP.
CONNECT tunnel failed, response 403 Proxy server ACL refuses the port; standard Squid configurations commonly allow CONNECT only to port 443. Use port 443 or ask which ports are permitted.
ERR_PROXY_CONNECTION_FAILED Browser Wrong host or port, proxy offline, or outbound port blocked. Test using nc -vz host port.
502 Bad Gateway Proxy server Target reset the connection, or a residential exit went offline. Retry with backoff on a new session.
504 Gateway Timeout Proxy server Target response exceeds the proxy timeout, sometimes because the exit is geographically distant. Choose a closer exit or increase the timeout.
429 Too Many Requests Target Request rate exceeds the website’s limit. Honor Retry-After, reduce concurrency, or use the official API.
403 or CAPTCHA Target Poor IP reputation or access restrictions. Check whether access is permitted and contact the provider if the IP needs replacement.

A 407 without a Proxy-Authenticate header didn’t come from a working proxy: RFC 9110 requires that header in every 407 a proxy generates, so no password will fix it. Scripts that read curl’s exit status need a version check too, because a failed tunnel returns 56 up to curl 8.19.0 and 7 from 8.20.0. Residential 502s are normal: GreyNoise’s 2026 data showed residential-sourced traffic from India falling 34% overnight as devices switch off. Proxys.io’s guide to proxy connection errors covers the browser side, with each ERR_ code reproduced in Chromium 141.

Limitations and Risks of Proxy Servers

Proxy Server Encryption: A proxy isn’t encryption. Through a plain HTTP proxy, Proxy-Authorization carries your password in Base64-encoded form, which can be intercepted on an unsecured network. Connecting to the proxy over TLS using an HTTPS proxy URL closes this gap; curl has supported HTTPS proxies since version 7.52.0. However, the proxy operator can still see every hostname, timestamp, and byte count.

Shared Proxy IP Risks: Shared IPs carry other people’s history. GreyNoise analyzed 4 billion malicious sessions from November 2025 to February 2026, finding that 39% of unique attacking IPs came from residential address space. Of those, 78% appeared in only one or two sessions. Defenders increasingly prioritize behavior over IP reputation, so legitimate users sharing these IP pools may encounter more CAPTCHAs.

Residential Proxy IP Sourcing: Ask how residential IPs are sourced. In January 2026, Google’s Threat Intelligence Group disrupted IPIDEA, a network reportedly handling 9 to 11 million daily proxies and used by more than 550 threat groups. Prefer providers that publish sourcing policies and vet customers; Bright Data, for example, conducts Know Your Customer (KYC) reviews before granting residential access. Remember that a new IP isn’t a new identity: cookies, logins, and browser fingerprints can still identify you.

Proxy Server vs VPN: A VPN using WireGuard, OpenVPN, or IPsec encrypts device traffic through a network-level tunnel. A proxy typically handles traffic for a specific application, doesn’t inherently encrypt connections, and can support control over hundreds of exit IPs. Use a VPN on untrusted networks and proxies when you need per-request control over exit IPs and locations.

How to Choose a Proxy Provider

List prices from each provider’s public pricing page; promotions change monthly.

Provider Residential, per GB Per-IP options Sessions Trial or refund
Proxys.io From $4 Dedicated IPv4 from $1.47 ($2.30 each for 1 to 4); IPv6 from $0.13 Rotation timer, 2 to 60 min 24-hour refund
Bright Data $8 pay-as-you-go; $5 to $7 on plans from $499/month Datacenter from $0.90 Extended sessions; KYC for residential Free trial
Oxylabs $6 up to 5 GB, $2.50 at 1,000+ GB Datacenter and ISP plans Sticky or rotating; HTTP/3 $5 credit
Decodo $4 pay-as-you-go; $3.75 (3 GB) to $2 (1 TB) Datacenter from $0.02 Same IP up to 30 min 3-day trial; 14-day refund
IPRoyal $7.35 (1 GB) to $1.84 (10 TB) Datacenter from $1.39 Sticky up to 7 days Free trial
Webshare $3.50 (1 GB) to $1.40 (3,000 GB) 100 shared proxies for $2.99/month; 10 free Static residential sold per IP Free plan; 2-day refund

IPRoyal’s rate falls 75% between 1 GB and 10 TB, Webshare’s 60%. Pool claims run from 64M+ IPs (IPRoyal) to 400M+ (Bright Data, counted monthly), so compare success rates on your own target instead. Billing rules differ too: Bright Data counts headers and bodies in both directions, and IPRoyal traffic never expires.

When Per-IP Pricing Beats Per-GB

The 2025 Web Almanac puts the median mobile home page at 2,362 KB. A QA team loading 300 full pages a day moves about 21 GB a month, roughly $85 at $4/GB. Two dedicated IPv4 addresses cost $4.60 a month at Proxys.io’s 1-to-4 rate. Blocking images narrows the gap, but steady, low-volume work against fixed sites favors per-IP billing.

That’s the niche Proxys.io has served since 2016: monthly billing per IP, HTTP(S) and SOCKS5 on every address, login or IP authentication, automatic delivery after payment and a 24-hour refund window. The limits are real. Static proxies get a 7 Mbit/s channel by default (10 on request), about 875 KB/s, which suits HTML and APIs but not bulk media, and the spec sheet publishes no success-rate or response-time figures. For city-level rotation across many countries, per-GB networks remain the better tool, and Proxys.io’s own residential pool (from $4/GB, 100M+ IPs) is priced with the mid-market, not below it.

Signs it’s Time to Switch Providers

Decide on numbers: a rising share of 403s and CAPTCHAs on unchanged traffic, IPs geolocating to the wrong country, replacements that take days, invoices that don’t match your byte counts. If replaced IPs get blocked again within days, the provider’s subnets likely have a reputation problem support can’t fix.

Testing a Proxy Server Before Rollout

Two commands confirm the basics, over HTTP CONNECT and over SOCKS5 with remote DNS:

curl -s -x "http://user:pass@198.51.100.25:3128" https://api.ipify.org
curl -s --socks5-hostname 198.51.100.25:1080 -U user:pass https://api.ipify.org

Then test against your real targets:

  1. Confirm the exit IP and its ASN match what you paid for. A whois lookup catches datacenter ranges sold as residential.
  2. Confirm traffic really goes through the proxy server. A NO_PROXY entry silently overrides curl’s -x and still returns 200, so check the exit IP, not the status code.
  3. Check the IP in two geolocation databases, such as MaxMind and IP2Location; sites use different ones, and both lag behind reassignments.
  4. Send 50 requests to the real target and record p50 and p95 time to first byte.
  5. Run the job for 24 hours before migrating, since exit churn and overnight dips only show over a full day.

Where to Start

Start with the cheapest IP type your target accepts for your permitted use and let measurements push you upward. A dedicated datacenter address, or IPv6 if the target publishes AAAA records, covers most API work, QA checks and allowlisting for a few dollars a month. Move to ISP or residential exits only when the 24-hour test shows a block rate the job can’t absorb and choose per-GB billing only after measuring how many bytes each task moves.

Proxy Server FAQs

Is a proxy server free?
Free public proxies exist, but they’re slow, short-lived and run by unknown operators, some of whom log traffic or inject ads. Paid options start low: Webshare’s free plan includes 10 shared proxies with 1 GB a month, and Proxys.io’s shared IPv4 costs from $0.67.

Should a proxy server be on or off?
Off, unless you or your IT team set it up. On a personal Windows machine, an unexpected entry under Settings, Network & Internet, Proxy deserves a look, because adware sometimes adds one to intercept traffic.

Is it legal to use a proxy server?
In most countries, yes. Proxies are standard in corporate networks and CDNs. Legality depends on the activity: breaching a site’s terms, unauthorized access or fraud stay unlawful whatever the IP. Check local law and each site’s terms for your specific use.

Linux Enterprise Server vs Windows Server: Which Fits Your Business?

5 Raspberry Pi AI Projects You Can Build with One API Key

IOT Based Air Quality Monitoring System with ESP32 & BME680 Sensor

TDS Sensor Based Water Quality Monitoring System Using ESP32 and Arduino

Build a Powerful and Affordable Raspberry Pi Media Server

Could 2026 Be the Year of Linux Gaming?

Leave a Reply

Your email address will not be published. Required fields are marked *