
在线客服
工作日:9:00-24:00
项目咨询
15675821581

QQ联系方式
3961604902

大客户经理
徐经理
专业客户经理,解答您的疑问
user-{sub_account_username}-country-{region}-province-{province}-city-{city}-session-{session_id}-sessiontime-{minutes}
user-{sub_account_username}-country-{region}
* Host: us-node1.ipcool.net
* Port: 8000 (假设入口端口)
* User: user-alice-country-US //指定国家美国
* Pass: alice_password
* Host: us-node1.ipcool.net
* Port: 8000
* User: user-alice-country-US-province-Mendocino //指定州/省Mendocino
* Pass: alice_password
* Host: us-node1.ipcool.net
* Port: 8000
* User: user-alice-country-US-province-California-city-Sacramento //指定城市Sacramento
* Pass: alice_password
* Host: us-node1.ipcool.net
* Port: 8000
* User: user-alice-country-us-session-mywork1-sessiontime-30
* Pass: alice_password
* 解释: 只要你一直用 session-mywork1 这个标签,且时间在 30 分钟内,系统会尽力给你同一个出口 IP。
* 解释: 如果同一个IP不可用,系统优先从当前session会话所在地区补充一个IP进行替换
#include "stdafx.h"
#include "curl/curl.h"
#pragma comment(lib, "libcurl.lib")
// curl 回调函数
static size_t write_buff_data(char *buffer, size_t size, size_t nitems, void *outstream)
{
// 把接收的数据拷贝到缓存中
memcpy(outstream, buffer, nitems * size);
return nitems * size;
}
/*
使用http代理
*/
int GetUrlHTTP(char *url, char *buff)
{
CURL *curl;
CURLcode res;
curl = curl_easy_init();
if (curl)
{
curl_easy_setopt(curl, CURLOPT_PROXY, "http://域名:端口"); // 设置http代理地址
curl_easy_setopt(curl, CURLOPT_PROXYUSERPWD, "用户名:密码"); // 代理用户名密码,以":"风格用户名以及密码
curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void*)buff); // 设置读写缓存
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_buff_data); // 设置回调函数
curl_easy_setopt(curl, CURLOPT_URL, url); // 设置url地址
curl_easy_setopt(curl, CURLOPT_LOW_SPEED_TIME, 10L);
curl_easy_setopt(curl, CURLOPT_LOW_SPEED_LIMIT, 50L);
curl_easy_setopt(curl, CURLOPT_MAX_RECV_SPEED_LARGE, 2000000L);
res = curl_easy_perform(curl);
curl_easy_cleanup(curl);
if (res == CURLE_OK)
{
return res;
}
else
{
printf("错误代码:%d\n", res);
MessageBox(NULL, TEXT("获取IP错误"), TEXT("助手"), MB_ICONINFORMATION | MB_YESNO);
}
}
return res;
}
/*
使用socks5代理
*/
int GetUrlSocks5(char *url, char *buff)
{
CURL *curl;
CURLcode res;
curl = curl_easy_init();
if (curl)
{
curl_easy_setopt(curl, CURLOPT_PROXY, "socks5://域名:端口"); // 设置socks5代理地址
curl_easy_setopt(curl, CURLOPT_PROXYUSERPWD, "用户名:密码"); // 代理用户名密码
curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void*)buff);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_buff_data);
curl_easy_setopt(curl, CURLOPT_URL, url);
curl_easy_setopt(curl, CURLOPT_LOW_SPEED_TIME, 10L);
curl_easy_setopt(curl, CURLOPT_LOW_SPEED_LIMIT, 50L);
curl_easy_setopt(curl, CURLOPT_MAX_RECV_SPEED_LARGE, 2000000L);
res = curl_easy_perform(curl);
curl_easy_cleanup(curl);
if (res == CURLE_OK)
{
return res;
}
else
{
printf("错误代码:%d\n", res);
MessageBox(NULL, TEXT("获取IP错误"), TEXT("助手"), MB_ICONINFORMATION | MB_YESNO);
}
}
return res;
}
/*
不使用代理
*/
int GetUrl(char *url, char *buff)
{
CURL *curl;
CURLcode res;
curl = curl_easy_init();
if (curl)
{
curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void*)buff);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_buff_data);
curl_easy_setopt(curl, CURLOPT_URL, url);
curl_easy_setopt(curl, CURLOPT_LOW_SPEED_TIME, 10L);
curl_easy_setopt(curl, CURLOPT_LOW_SPEED_LIMIT, 50L);
curl_easy_setopt(curl, CURLOPT_MAX_RECV_SPEED_LARGE, 2000000L);
res = curl_easy_perform(curl);
curl_easy_cleanup(curl);
if (res == CURLE_OK)
{
return res;
}
else
{
printf("错误代码:%d\n", res);
MessageBox(NULL, TEXT("获取IP错误"), TEXT("助手"), MB_ICONINFORMATION | MB_YESNO);
}
}
return res;
}
int main()
{
char *buff = (char*)malloc(1024 * 1024);
memset(buff, 0, 1024 * 1024);
// 不使用http代理
GetUrl("http://ipinfo.io", buff);
printf("不使用代理:%s\n", buff);
// 使用http代理
memset(buff, 0, 1024 * 1024);
GetUrlHTTP("http://ipinfo.io", buff);
printf("http结果:%s\n", buff);
// 使用socks5代理
memset(buff, 0, 1024 * 1024);
GetUrlSocks5("http://ipinfo.io", buff);
printf("socks5结果:%s\n", buff);
Sleep(1000 * 1000);
free(buff);
return 0;
}package main
import (
"context"
"fmt"
"golang.org/x/net/proxy"
"io/ioutil"
"net"
"net/http"
"net/url"
"strings"
"time"
)
var testApi = "https://ipinfo.io/"
func main() {
getMyIp()
// 账密
go httpProxy("ip:port", "账户", "密码")
go Socks5Proxy("ip:port", "账户", "密码")
time.Sleep(time.Minute)
}
func getMyIp() {
rsp, err := http.Get("https://ipinfo.io/")
if err != nil {
fmt.Println("获取本机ip失败", err.Error())
return
}
defer rsp.Body.Close()
body, err := ioutil.ReadAll(rsp.Body)
if err != nil {
fmt.Println(err.Error())
return
}
fmt.Println(time.Now().Format("2006-01-02 15:04:05 07"), "本机ip:", string(body))
}
// http代理
func httpProxy(proxyUrl, user, pass string) {
defer func() {
if err := recover(); err != nil {
fmt.Println(time.Now().Format("2006-01-02 15:04:05 07"), "http", "返回信息:", err)
}
}()
urli := url.URL{}
if !strings.Contains(proxyUrl, "http") {
proxyUrl = fmt.Sprintf("http://%s", proxyUrl)
}
urlProxy, _ := urli.Parse(proxyUrl)
if user != "" && pass != "" {
urlProxy.User = url.UserPassword(user, pass)
}
client := &http.Client{
Transport: &http.Transport{
Proxy: http.ProxyURL(urlProxy),
},
}
rqt, err := http.NewRequest("GET", testApi, nil)
if err != nil {
panic(err)
return
}
response, err := client.Do(rqt)
if err != nil {
panic(err)
return
}
defer response.Body.Close()
body, _ := ioutil.ReadAll(response.Body)
fmt.Println(time.Now().Format("2006-01-02 15:04:05 07"), proxyUrl, "【http success】", "返回信息:",
response.Status, string(body))
}
// socks5代理
func Socks5Proxy(proxyUrl, user, pass string) {
defer func() {
if err := recover(); err != nil {
fmt.Println(time.Now().Format("2006-01-02 15:04:05 07"), proxyUrl, "返回信息:", err)
}
}()
var userAuth proxy.Auth
if user != "" && pass != "" {
userAuth.User = user
userAuth.Password = pass
}
dialer, err := proxy.SOCKS5("tcp", proxyUrl, &userAuth, proxy.Direct)
if err != nil {
panic(err)
}
httpClient := &http.Client{
Transport: &http.Transport{
DialContext: func(ctx context.Context, network, addr string) (conn net.Conn, err error) {
return dialer.Dial(network, addr)
},
},
Timeout: time.Second * 10,
}
// 请求网络
if resp, err := httpClient.Get(testApi); err != nil {
panic(err)
} else {
defer resp.Body.Close()
body, _ := ioutil.ReadAll(resp.Body)
fmt.Println(time.Now().Format("2006-01-02 15:04:05 07"), proxyUrl, "【socks5 success】", "返回信息:",
string(body))
}
}package demo;
import okhttp3.Credentials;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.PasswordAuthentication;
import java.net.Proxy;
/**
* compile 'com.squareup.okhttp3:okhttp:3.10.0'
*/
public class AutProxyJava {
public static void main(String[] args) throws IOException {
testWithOkHttp();
testSocks5WithOkHttp();
}
public static void testWithOkHttp() throws IOException {
String url = "https://ipinfo.io";
Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress("代理地址", 8080));
OkHttpClient client = new OkHttpClient.Builder()
.proxy(proxy)
.proxyAuthenticator((route, response) -> {
String credential = Credentials.basic("账户", "密码");
return response.request().newBuilder()
.header("Proxy-Authorization", credential)
.build();
})
.build();
Request request = new Request.Builder().url(url).build();
Response response = client.newCall(request).execute();
String responseString = response.body().string();
System.out.println(responseString);
}
public static void testSocks5WithOkHttp() throws IOException {
String url = "https://ipinfo.io/";
Proxy proxy = new Proxy(Proxy.Type.SOCKS, new InetSocketAddress("代理地址", 8080));
java.net.Authenticator.setDefault(new java.net.Authenticator() {
private PasswordAuthentication authentication = new PasswordAuthentication("账户", "密码".toCharArray());
@Override
protected PasswordAuthentication getPasswordAuthentication() {
return authentication;
}
});
OkHttpClient client = new OkHttpClient.Builder()
.proxy(proxy)
.build();
Request request = new Request.Builder().url(url).build();
Response response = client.newCall(request).execute();
String responseString = response.body().string();
System.out.println(responseString);
}
}require('request-promise')({
url: 'https://ipinfo.io',
proxy: 'http://???-zone-custom:????@proxy.ipcool.net:2333',
}).then(function (data) { console.log(data); },
function (err) { console.error(err); });// 要访问的目标页面
$targetUrl = "http://baidu.com";
// 代理服务器
$proxyServer = "http://proxy.ipcool.net:2333";
$proxyUserPwd = ":";
// 隧道身份信息
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $targetUrl);
curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
// 设置代理服务器
curl_setopt($ch, CURLOPT_PROXYTYPE, 0); // http
// curl_setopt($ch, CURLOPT_PROXYTYPE, 5); // sock5
curl_setopt($ch, CURLOPT_PROXY, $proxyServer);
// 设置隧道验证信息
curl_setopt($ch, CURLOPT_PROXYAUTH, CURLAUTH_BASIC);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR
2.0.50727;)");
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 3);
curl_setopt($ch, CURLOPT_TIMEOUT, 5);
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_PROXYUSERPWD, $proxyUserPwd);
$result = curl_exec($ch);
$err = curl_error($ch);
curl_close($ch);
var_dump($err);
var_dump($result);import _thread
import time
import requests
headers = {
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_3 like Mac OS X) AppleWebKit/603.3.8 (KHTML, like
Gecko) Mobile/14G60 MicroMessenger/6.5.19 NetType/4G Language/zh_TW",
}
mainUrl = 'https://ipinfo.io/'
def testUrl():
# 账密
entry = 'http://{}:{}@ip:port'.format("账户", "密码")
proxy = {
'http': entry,
'https': entry,
}
try:
res = requests.get(mainUrl, headers=headers, proxies=proxy, timeout=10)
print(res.status_code, res.text)
except Exception as e:
print("访问失败", e)
pass
for port in range(0, 10):
_thread.start_new_thread(testUrl, ())
time.sleep(0.1)
time.sleep(10)该服务仅提供海外网络环境中使用,不支持中国境内IP链接代理服务器。请遵守当地法律法规。
请确保您的客户端 IP 已加入白名单,否则 API 将返回 403 权限错误。
account
custom zone BR:[mssword]
zone BR 巴西zone Jp日本zone GB 英国zone KR 韩国示例:
#访问韩国 curl -xus.ipcool.net:2555-U "[account] custom zone KR:[password]" ipinfo.io| 账户名称/密码 | 可用流量(GB) | 已用流量(GB) | 使用率 | 状态 | 操作 |
|---|---|---|---|---|---|
| 暂无数据 | |||||
支持 IPv4 地址,暂不支持掩码段 (CIDR) 格式。
白名单同步全网节点通常需要 1-3 分钟,请耐心等待。