ProGirlXOXO
ProGirlXOXO

Reputation: 2300

curl through proxy syntax

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

Upvotes: 6

Views: 45325

Answers (2)

ProGirlXOXO
ProGirlXOXO

Reputation: 2300

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

Upvotes: 12

I Iv
I Iv

Reputation: 21

If you use domain

curl -x proxy:81 -U domain\login:password https://stackoverflow.com/

Upvotes: 2

Related Questions