Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

performing HTTP requests with cURL (using PROXY)

Tags:

linux

curl

proxy

I have this proxy address: 125.119.175.48:8909

How can I perform a HTTP request using cURL like curl http://www.example.com, but specifying the proxy address of my network?

like image 396
user873286 Avatar asked Feb 25 '12 15:02

user873286


People also ask

How do I use curl with a proxy?

To use a proxy with Curl, you must pass the required proxy address using the -x (or --proxy) command-line option and proxy credentials using the -U (or --proxy-user) command-line switch. Proxy credentials may also be passed in the proxy string and will be URL decoded by Curl.

Does curl respect Http_proxy?

Many UNIX programs respect the http_proxy environment variable, curl included. The format curl accepts is [protocol://]<host>[:port] . For proxying HTTPS requests, set https_proxy as well.


1 Answers

From man curl:

-x, --proxy <[protocol://][user:password@]proxyhost[:port]>       Use the specified HTTP proxy.       If the port number is not specified, it is assumed at port 1080. 
like image 121
Karl Barker Avatar answered Oct 13 '22 02:10

Karl Barker