Making Requests
Basic query
Basic query only requires passing username and password. No other parameters are needed. Such a query will result in the request being made from a random IP address (proxy). Every new request will use a different proxy.
Code examples
In this example, a query to ipinfo.pyproxy.io is performed from a random IP:
curl -x pr.pyproxy.com:16666 -U "USERNAME-zone-resi:PASSWORD" ipinfo.pyproxy.io// demo.cpp : Define the entry point of a console application
//
#include "stdafx.h"
#include "curl/curl.h"
#pragma comment(lib, "libcurl.lib")
//cURL callback function
static size_t write_buff_data(char *buffer, size_t size, size_t nitems, void *outstream)
{
//Copy the received data to a buffer
memcpy(outstream, buffer, nitems*size);
return nitems*size;
}
/*
Use an HTTP proxy
*/
int GetUrlHTTP(char *url, char *buff)
{
CURL *curl;
CURLcode res;
curl = curl_easy_init();
if (curl)
{
curl_easy_setopt(curl, CURLOPT_PROXY,"http://proxy server:port");//Set the HTTP proxy address
curl_easy_setopt(curl, CURLOPT_PROXYUSERPWD, "USERNAME-zone-resi:PASSWORD");//username and password, separated by ":"
curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void*)buff);//Set read/write buffers
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_buff_data);//Set callback function
curl_easy_setopt(curl, CURLOPT_URL, url);//Set URL address
curl_easy_setopt(curl, CURLOPT_LOW_SPEED_TIME, 10L);//Set a long integer to control the number of seconds to transfer the bytes defined by CURLOPT_LOW_SPEED_LIMIT
curl_easy_setopt(curl, CURLOPT_LOW_SPEED_LIMIT, 50L);//Set a long integer to control the number of bytes to transfer
curl_easy_setopt(curl, CURLOPT_MAX_RECV_SPEED_LARGE, 2000000L);//Maximum download speed
res = curl_easy_perform(curl);
curl_easy_cleanup(curl);
if (res == CURLE_OK){
return res;
}else {
printf("Error code:%d\n", res);
MessageBox(NULL, TEXT("Get IP error"), TEXT("Helper"), MB_ICONINFORMATION | MB_YESNO);
}
}
return res;
}
/*
Use a SOCKS5 proxy
*/
int GetUrlSocks5(char *url, char *buff)
{
CURL *curl;
CURLcode res;
curl = curl_easy_init();
if (curl)
{
curl_easy_setopt(curl, CURLOPT_PROXY, "socks5://proxy server:port");//Set the SOCKS5 proxy address
curl_easy_setopt(curl, CURLOPT_PROXYUSERPWD, "username:password");//username and password, separated by ":"
curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void*)buff);//Set read/write buffers
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_buff_data);//Set callback function
curl_easy_setopt(curl, CURLOPT_URL, url);//Set URL address
curl_easy_setopt(curl, CURLOPT_LOW_SPEED_TIME, 10L);//Set a long integer to control the number of seconds to transfer the bytes defined by CURLOPT_LOW_SPEED_LIMIT
curl_easy_setopt(curl, CURLOPT_LOW_SPEED_LIMIT, 50L);//Set a long integer to control the number of bytes to transfer
curl_easy_setopt(curl, CURLOPT_MAX_RECV_SPEED_LARGE, 2000000L);/*Maximum download speed*/
res = curl_easy_perform(curl);
curl_easy_cleanup(curl);
if (res == CURLE_OK) {
return res;
}
else {
printf("Error code:%d\n", res);
MessageBox(NULL, TEXT("Get IP error"), TEXT("Helper"), MB_ICONINFORMATION | MB_YESNO);
}
}
return res;
}
/*
Don't use a proxy
*/
int GetUrl(char *url, char *buff)
{
CURL *curl;
CURLcode res;
//The cURL library used, initialize the cURL library
curl = curl_easy_init();
if (curl)
{
curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void*)buff);//Set read/write buffers
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_buff_data);//Set callback function
curl_easy_setopt(curl, CURLOPT_URL, url);//Set URL address
curl_easy_setopt(curl, CURLOPT_LOW_SPEED_TIME, 10L);//Set a long integer to control the number of seconds to transfer the bytes defined by CURLOPT_LOW_SPEED_LIMIT
curl_easy_setopt(curl, CURLOPT_LOW_SPEED_LIMIT, 50L);//Set a long integer to control the number of bytes to transfer
curl_easy_setopt(curl, CURLOPT_MAX_RECV_SPEED_LARGE, 2000000L);/*Maximum download speed*/
res = curl_easy_perform(curl);
curl_easy_cleanup(curl);
if (res == CURLE_OK)
{
return res;
}
else {
printf("Error code:%d\n", res);
MessageBox(NULL, TEXT("Get IP error"), TEXT("Helper"), MB_ICONINFORMATION | MB_YESNO);
}
}
return res;
}
int main()
{
char *buff=(char*)malloc(1024*1024);
memset(buff, 0, 1024 * 1024);
//Not use an HTTP proxy
GetUrl("http://myip.top", buff);
printf("Not use proxy:%s\n", buff);
//Use an HTTP proxy
memset(buff, 0, 1024 * 1024);
GetUrlHTTP("http://ipinfo.io", buff);
printf("HTTP result:%s\n", buff);
//Use a SOCKS5 proxy
memset(buff, 0,1024 * 1024);
GetUrlSocks5("http://ipinfo.io", buff);
printf("SOCKS5 result:%s\n", buff);
free(buff);
Sleep(10 * 1000);//Wait 10 seconds and exit
Wait 10 seconds and exit
return 0;
}A single backconnect proxy (pr.pyproxy.com:16666) enables you to choose a specifi
A single backconnect proxy (pr.pyproxy.com:16666) enables you to choose a s
A single backconnect proxy (pr.pyproxy.com:16666) enables you to choose a specific country or city proxy via additional parameters in the username. This approach also supports session control. Here is a sample of credentials:
Below is a breakdown of the structure:

Query parameters
username
Proxy account username
zone
Name for IP pool
region
Country/region, random region without this parameter
st
The state you want to specify.
city
The city you want to specify. It can be used without "state" parameter.
session
Required for Sticky IP and switching IPs.Use it when fixing an IP or finding specific IP when switching.
sessTime
Use with session to set IP duration.
password
Proxy account password
Last updated