# cURL

Source: https://docs.evomi.com/proxy-instructions/integration-guides/curl/

This guide shows how to use Evomi proxies with cURL, the command-line tool for making HTTP requests. cURL is the fastest way to test your proxy connection and is available by default on macOS, Linux, and Windows 10+.

## Quick Start

### HTTP Proxy

```bash
curl -x http://rp.evomi.com:1000 -U your_username:your_password_session-anychars_mode-speed https://ip.evomi.com/s
```

### HTTPS Proxy

```bash
curl -x https://rp.evomi-proxy.com:1001 -U your_username:your_password_session-anychars_mode-speed https://ip.evomi.com/s
```

The HTTPS endpoint uses the `evomi-proxy.com` domain — that is the hostname our TLS certificate covers, and it reaches the same servers. Without it, cURL rejects the handshake with `SSL: no alternative certificate subject name matches target host name`.

### SOCKS5 Proxy

```bash
curl -x socks5h://rp.evomi.com:1002 -U your_username:your_password_session-anychars_mode-speed https://ip.evomi.com/s
```

Replace `your_username` and `your_password` with your actual Evomi credentials (keep the `_session-anychars_mode-speed` parameters).

The examples above pass the credentials with `-U` instead of embedding them in the proxy URL. Both forms are equivalent — cURL sends the same proxy authentication either way — but `-U` saves you from URL-encoding passwords that contain `@`, `:` or other reserved characters.

The output should display the proxy server's IP address, not your real IP.

## Syntax Options

cURL provides several ways to specify proxy settings:

### Inline credentials (most common)

```bash
curl -x http://user:pass@host:port https://example.com
```

### Separate credentials flag

```bash
curl -x http://rp.evomi.com:1000 -U your_username:your_password_session-anychars_mode-speed https://ip.evomi.com/s
```

### Long-form flags

```bash
curl --proxy http://rp.evomi.com:1000 --proxy-user your_username:your_password_session-anychars_mode-speed https://ip.evomi.com/s
```

### Environment variable

<!--email_off-->
```bash
export https_proxy=http://your_username:your_password_session-anychars_mode-speed@rp.evomi.com:1000
curl https://ip.evomi.com/s
```
<!--email_on-->

This sets the proxy for all subsequent cURL requests in the current shell session.

## SOCKS5: Local vs Remote DNS

- **`socks5h://`** -- DNS is resolved by the proxy server (recommended, prevents DNS leaks)
- **`socks5://`** -- DNS is resolved locally before sending through the proxy

```bash
# Recommended: proxy resolves DNS
curl -x socks5h://rp.evomi.com:1002 -U your_username:your_password_session-anychars_mode-speed https://ip.evomi.com/s

# Local DNS resolution
curl -x socks5://rp.evomi.com:1002 -U your_username:your_password_session-anychars_mode-speed https://ip.evomi.com/s
```

## Common Options

```bash
# Verbose output (shows proxy connection details)
curl -v -x http://rp.evomi.com:1000 -U user:pass https://ip.evomi.com/s

# Set a timeout (30 seconds)
curl --connect-timeout 30 -x http://rp.evomi.com:1000 -U user:pass https://ip.evomi.com/s

# Follow redirects
curl -L -x http://rp.evomi.com:1000 -U user:pass https://example.com

# Custom User-Agent
curl -A "Mozilla/5.0 (Windows NT 10.0; Win64; x64)" -x http://rp.evomi.com:1000 -U user:pass https://example.com

# Save response to file
curl -o output.html -x http://rp.evomi.com:1000 -U user:pass https://example.com
```

## Evomi Proxy Endpoints

| Proxy Type | HTTP | HTTPS | SOCKS5 |
|---|---|---|---|
| **Residential** | `rp.evomi.com:1000` | `rp.evomi-proxy.com:1001` | `rp.evomi.com:1002` |
| **Mobile** | `mp.evomi.com:3000` | `mp.evomi-proxy.com:3001` | `mp.evomi.com:3002` |
| **Datacenter** | `dcp.evomi.com:2000` | `dcp.evomi-proxy.com:2001` | `dcp.evomi.com:2002` |

HTTPS endpoints use the `evomi-proxy.com` domain — that is the hostname our TLS certificate covers, and it reaches the same servers. A client that verifies certificates will reject the `evomi.com` form on the HTTPS port.

## Tips and Troubleshooting

- **Special characters in password**: If your password contains special characters (`@`, `:`, `!`), URL-encode them or use the `-U` flag to pass credentials separately.
- **Verbose mode**: Use `-v` to see the full connection flow, including proxy handshake and authentication.
- **Connection refused**: Verify the hostname and port. Make sure you are using the correct protocol (`http://` vs `socks5h://`) for the port.
- **Timeout errors**: Increase the timeout with `--connect-timeout` and `--max-time`. Proxy connections may be slower than direct connections.
- **Unset proxy**: If you set a proxy via environment variable and want to bypass it for a single request, use `--noproxy "*"`.
