Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

curl through proxy syntax

Tags:

curl

proxy

I don't understand how to read this general syntax. I want to request a URL through our proxy and it requires a specific host, port, username, and password. I don't know how to figure out what the protocol is. I want to do curl through a proxy. Based on the helpfile below, I would guess the line should be:

curl -x [whatever-my-protocol-is://]my-host-which-i-know[:my-port-which-i-know] -U my-username-which-i-know[:my-pass-which-i-know] http://www.google.com

Is this right? How do I figure out the protocol?

Relevant info from man:

-x, --proxy [PROTOCOL://]HOST[:PORT] Use proxy on given port
     --proxy-anyauth Pick "any" proxy authentication method (H)
     --proxy-basic   Use Basic authentication on the proxy (H)
     --proxy-digest  Use Digest authentication on the proxy (H)
     --proxy-negotiate Use Negotiate authentication on the proxy (H)
     --proxy-ntlm    Use NTLM authentication on the proxy (H)
 -U, --proxy-user USER[:PASSWORD]  Proxy user and password
     --proxy1.0 HOST[:PORT]  Use HTTP/1.0 proxy on given port
like image 630
ProGirlXOXO Avatar asked Jul 23 '13 19:07

ProGirlXOXO


2 Answers

Ignore "[" when reading general syntax. Also, windows likes double vs single quotes.

So the command is:

curl -x my-host-which-i-know:my-port-which-i-know -U my-username-which-i-know:my-pass-which-i-know http://www.google.com
like image 73
ProGirlXOXO Avatar answered Oct 18 '22 08:10

ProGirlXOXO


If you use domain

curl -x proxy:81 -U domain\login:password https://stackoverflow.com/
like image 2
I Iv Avatar answered Oct 18 '22 07:10

I Iv