These curl recipes show you how to proxy your curl requests through a socks4, socks5, or a regular http (or https) proxy. To set a proxy, use the -x protocol://user:password@host:port command line argument.

Use a Socks5 Proxy

curl -x socks5://

In this recipe, curl uses the -x argument to set the proxy protocol to socks5, proxy username to james, proxy password to cats, proxy hostname to, and proxy port to 8080. After connecting to the proxy, curl then makes a GET request to

Use a Socks4 Proxy

curl -x socks4://

This recipe is a carbon copy of the previous recipe. The only change is that the protocol has been set to socks4.

Use an HTTP Proxy

curl -x

In this recipe, the protocol:// part of the proxy address is not specified. In this case, the HTTP proxy is assumed. Just like in the previous two recipes, the username and password are set to james:cats and the proxy host and port are set to

Don't Use a Proxy for

curl --no-proxy -x

In this recipe, the --no-proxy command line argument is used. This argument prevents curl from proxying requests to The next argument is -x that sets the HTTPS proxy for curl to (without username or password). After this, curl makes three requests to,, and The first two requests are proxied through but the last request is not proxied because matches the proxy ignore list.

Created by Browserling

These curl recipes were written down by me and my team at Browserling. We use recipes like this every day to get things done and improve our product. Browserling itself is an online cross-browser testing service powered by alien technology. Check it out!

Secret message: If you love my curl recipe, then I love you, too! Use coupon code CURLLING to get a discount at my company.