Authenticate to a proxy with username and password.

Section: Proxy Auth and Tunnels

Proxy with basic auth

bash
bash
curl -x http://proxy.example.com:8080 -U 'user:password' https://example.com
Explanation

Use `-U` / `--proxy-user` for proxy credentials.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Proxy Auth and Tunnels
Use an HTTPS proxy
Route traffic through an HTTPS proxy.
OpenIn sheetbashsame section
Trust a custom CA for proxy TLS
Use a custom CA certificate file for the HTTPS proxy.
OpenIn sheetbashsame section
Client cert for proxy authentication
Send a client certificate when the proxy requires mTLS.
OpenIn sheetbashsame section
Tunnel through an HTTP proxy
Use CONNECT tunneling for non-HTTP protocols when needed.
OpenIn sheetbashsame section
Use credentials from .netrc
Load login credentials from a `.netrc` file.
OpenIn sheetbash2 tag match
Use a custom netrc file
Read machine credentials from a specific netrc file.
OpenIn sheetbash2 tag match