Skip to content

发起代理请求 ​

拿到提取到的自定义端口端点(如 us-ca.edge.joyproxy.com:20001)和代理账密后,可以在各种主流编程语言或第三方软件中发起 HTTP / SOCKS5 请求。

请将示例代码中的 USER、PASS 和 us-ca.edge.joyproxy.com:20001 替换为你实际的凭据与端口端点:


编程语言代码示例 ​

cURL ​

bash
# HTTP 代理测试
curl -x http://USER:[email protected]:20001 https://api.ipify.org

# SOCKS5 代理测试
curl --socks5 http://USER:[email protected]:20001 https://api.ipify.org

Python (Requests) ​

python
import requests

proxy_url = "http://USER:[email protected]:20001"
proxies = {
    "http": proxy_url,
    "https": proxy_url,
}

try:
    response = requests.get("https://api.ipify.org", proxies=proxies, timeout=15)
    print("当前端口出口 IP:", response.text)
except requests.exceptions.RequestException as e:
    print("代理连接失败:", e)

Node.js (Axios) ​

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

const proxyUrl = 'http://USER:[email protected]:20001';
const agent = new HttpsProxyAgent(proxyUrl);

axios.get('https://api.ipify.org', { httpAgent: agent, httpsAgent: agent })
  .then(res => console.log('当前端口出口 IP:', res.data))
  .catch(err => console.error('代理连接报错:', err.message));

Go ​

go
package main

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

func main() {
	proxyUrl, _ := url.Parse("http://USER:[email protected]:20001")
	client := &http.Client{
		Transport: &http.Transport{
			Proxy: http.ProxyURL(proxyUrl),
		},
	}

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

	body, _ := io.ReadAll(resp.Body)
	fmt.Println("当前端口出口 IP:", string(body))
}

PHP ​

php
<?php
$ch = curl_init('https://api.ipify.org');
curl_setopt($ch, CURLOPT_PROXY, 'http://us-ca.edge.joyproxy.com:20001');
curl_setopt($ch, CURLOPT_PROXYUSERPWD, 'USER:PASS');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 15);

$response = curl_exec($ch);
if (curl_errno($ch)) {
    echo 'Curl error: ' . curl_error($ch);
} else {
    echo '当前端口出口 IP: ' . $response;
}
curl_close($ch);

第三方软件与指纹浏览器集成 ​