# Code Examples

All examples use credential mode. Replace `USERNAME` and `PASSWORD` with the credentials from the dashboard's Proxy Settings page and they run as-is. For username parameters, see the [syntax reference](https://www.eproxies.io/docs/usage/username-syntax).

## cURL

```bash
# HTTP proxy
curl -x proxy.eproxies.net:23333 -U "USERNAME-pool-flow-region-US:PASSWORD" https://ipinfo.io

# SOCKS5 proxy (same port)
curl -x socks5://USERNAME-pool-flow-region-US:PASSWORD@proxy.eproxies.net:23333 https://ipinfo.io
```

## Python (requests)

```python
import requests

proxy_url = "http://USERNAME-pool-flow-region-US:PASSWORD@proxy.eproxies.net:23333"
proxies = {"http": proxy_url, "https": proxy_url}

response = requests.get("https://ipinfo.io", proxies=proxies, timeout=30)
print(response.json())
```

For SOCKS5: change `http://` to `socks5://` and install the extra: `pip install "requests[socks]"`.

## Node.js (axios)

```javascript
const axios = require("axios");
const { HttpsProxyAgent } = require("https-proxy-agent");

const agent = new HttpsProxyAgent(
  "http://USERNAME-pool-flow-region-US:PASSWORD@proxy.eproxies.net:23333"
);

axios
  .get("https://ipinfo.io", { httpsAgent: agent, timeout: 30000 })
  .then((res) => console.log(res.data))
  .catch((err) => console.error(err.message));
```

## Java (OkHttp)

```java
import java.net.InetSocketAddress;
import java.net.Proxy;
import okhttp3.Credentials;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;

public class EProxiesDemo {
    public static void main(String[] args) throws Exception {
        Proxy proxy = new Proxy(Proxy.Type.HTTP,
                new InetSocketAddress("proxy.eproxies.net", 23333));

        OkHttpClient client = new OkHttpClient.Builder()
                .proxy(proxy)
                .proxyAuthenticator((route, response) -> {
                    String credential = Credentials.basic(
                            "USERNAME-pool-flow-region-US", "PASSWORD");
                    return response.request().newBuilder()
                            .header("Proxy-Authorization", credential)
                            .build();
                })
                .build();

        Request request = new Request.Builder().url("https://ipinfo.io").build();
        try (Response response = client.newCall(request).execute()) {
            System.out.println(response.body().string());
        }
    }
}
```

## Go

```go
package main

import (
	"fmt"
	"io"
	"net/http"
	"net/url"
)

func main() {
	proxyURL, _ := url.Parse(
		"http://USERNAME-pool-flow-region-US:PASSWORD@proxy.eproxies.net:23333")

	client := &http.Client{
		Transport: &http.Transport{Proxy: http.ProxyURL(proxyURL)},
	}

	resp, err := client.Get("https://ipinfo.io")
	if err != nil {
		panic(err)
	}
	defer resp.Body.Close()

	body, _ := io.ReadAll(resp.Body)
	fmt.Println(string(body))
}
```

## PHP (cURL)

```php
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://ipinfo.io");
curl_setopt($ch, CURLOPT_PROXY, "proxy.eproxies.net:23333");
curl_setopt($ch, CURLOPT_PROXYUSERPWD, "USERNAME-pool-flow-region-US:PASSWORD");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
curl_close($ch);
echo $result;
```

> The dashboard's Code Examples page also offers C/C++ versions, plus step-by-step GUI setup guides for Chrome, Edge, Firefox, and Safari as well as Android and iOS — with your real credentials filled in automatically.

## Verification & troubleshooting

* Use `https://ipinfo.io` to confirm the exit IP and targeting match expectations.
* Getting 407: check that the username contains `-pool-flow` and the credentials are correct.
* Timeouts: strip the targeting parameters and test basic connectivity with `USERNAME-pool-flow`, then add parameters back one at a time to isolate the issue.
* For automation frameworks (Selenium / Puppeteer / Playwright / Scrapy), see [Automation Frameworks](https://www.eproxies.io/docs/integrations/automation-frameworks).
