控制台

代码示例

所有示例使用账密模式。把 USERNAMEPASSWORD 替换成控制台「代理设置」页的凭据即可运行;username 参数语法见语法参考

cURL

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

# SOCKS5 代理(同端口)
curl -x socks5://USERNAME-pool-flow-region-US:[email protected]:23333 https://ipinfo.io

Python(requests)

import requests

proxy_url = "http://USERNAME-pool-flow-region-US:[email protected]:23333"
proxies = {"http": proxy_url, "https": proxy_url}

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

SOCKS5 写法:把 http:// 换成 socks5://,并安装扩展:pip install "requests[socks]"

Node.js(axios)

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

const agent = new HttpsProxyAgent(
  "http://USERNAME-pool-flow-region-US:[email protected]:23333"
);

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

Java(OkHttp)

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

package main

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

func main() {
    proxyURL, _ := url.Parse(
        "http://USERNAME-pool-flow-region-US:[email protected]: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
$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;

控制台「代码示例」页还提供 C/C++ 版本,以及 Chrome、Edge、Firefox、Safari 浏览器和 Android、iOS 移动端的图形化配置指引,并会自动带入你的真实凭据。

验证与排错

  • https://ipinfo.io 验证出口 IP 和定位是否符合预期。
  • 返回 407:检查 username 是否含 -pool-flow、凭据是否正确。
  • 超时:先去掉定位参数用 USERNAME-pool-flow 测试基础连通性,再逐步加参数定位问题。
  • 自动化框架(Selenium / Puppeteer / Playwright / Scrapy)的接入方法见自动化框架