Email
Enterprise Service
Telegram
menu
Email
Telegram
Enterprise Service
Submit
Basic information
Waiting for a reply
Your form has been submitted. We'll contact you in 24 hours.
Close

Rotating Residential Proxies

Residential proxies are proxy servers that route internet traffic through real residential IP addresses. These IP addresses are attached to physical devices across the globe at a country or city level. Therefore, this type of proxies can provide enhanced anonymity and make it harder for websites to detect and block proxy usage.
PYPROXY Residential Proxies are fully equipped and are easy to set up. Find everything about Rotating Residential Proxies integration in this documentation.
If you need any assistance, feel free to contact us at service@pyproxy.com.
Technical support

Get Started

Make a request to https://ipinfo.pyproxy.io/ using a residential proxy from a random location through our entry. Replace USERNAME and PASSWORD with your proxy user credentials. Keep in mind that each request returns a new IP address as PYPROXY Rotating Residential Proxies rotate automatically.
Use ipinfo.pyproxy.io to check the parameters of your IPs. The parameters include IP address, country, city, ZIP code, ASN, ASN name, and time zone.
curl -x pr.pyproxy.com:16666 -U "USERNAME-zone-resi:PASSWORD" ipinfo.pyproxy.io
Our Residential Proxies support HTTP, HTTPS, and SOCKS5 protocols.
Now make a request using a proxy from the USA. All you need to do is add region-us to your username string. Below is an example in cURL, and here you can find code samples in other languages.
cURL
C/C++
GO
Node.js
PHP
JAVA
Python
curl -x pr.pyproxy.com:16666 -U "USERNAME-zone-resi-region-us: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-region-us: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;
}
package main

import (
    "context"
    "fmt"
    "io/ioutil"
    "net"
    "net/http"
    "net/url"
    "strings"
    "time"

    "golang.org/x/net/proxy"
)

// User Pass Auth Setting
var account = "USERNAME-zone-resi-region-us"//Proxy_username
var password = "PASSWORD"//Proxy_password

// Proxy server
var proxyServer = "HOST:PORT"//Example:xxx.na.pyproxy.io:2336;

// Test URL
var testApi = "https://ipinfo.pyproxy.io"

func main() {
    go httpProxy(proxyServer, account, password)
    go Socks5Proxy(proxyServer, account, password)

    time.Sleep(time.Minute)
}

// http proxy
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", "response:", 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:", response.Status, string(body))

    return
}

// socks5 proxy
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, "response:", 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】", "response:", string(body))
    }
}
#!/usr/bin/env node
require('request-promise')({
    url: 'https://ipinfo.io',//Request URL
    proxy: 'http://USERNAME-zone-resi-region-us:PASSWORD@proxy.pyproxy.io:2333',//proxy username-zone-proxy pool:proxy username@proxy server address
    })
.then(function(data){ console.log(data); },
    function(err){ console.error(err); });
<?php
//User Pass Auth setting
$user = "USERNAME-zone-resi-region-us";//Proxy_username
$password = "PASSWORD";//Proxy_password
// Target URL
$targetUrl = "http://google.com";
// Proxy server
$proxyServer = "proxy address";  //Example:xxx.na.pyproxy.io:2336;
$proxyUserPwd = "$user:$password";
                                
// Tunnel verification
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $targetUrl);
curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
                                
// Set proxy server
curl_setopt($ch, CURLOPT_PROXYTYPE, 0); //http
// curl_setopt($ch, CURLOPT_PROXYTYPE, 5); //sock5
curl_setopt($ch, CURLOPT_PROXY, $proxyServer);
                                
// Set tunnel verification information
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);
package demo;

import okhttp3.Credentials;
import okhttp3.OkHttpClient;
import okhttp3.Request;

import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.PasswordAuthentication;
import java.net.Proxy;

/**
 * compile 'com.squareup.okhttp3:okhttp:4.9.3'
 */
class AutProxyJava {
    public static void main(String[] args) throws IOException {
        testWithOkHttp();

        testSocks5WithOkHttp();
    }

    /**
     * http proxy
     */
    public static void testWithOkHttp() throws IOException {
        String url = "https://ipinfo.pyproxy.io";//Request URL
        //Create a proxy object of type HTTP and specify the host name and port number of the proxy server
        Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress("host", "port"));//The "host" and "port" used here should be replaced with the proxy server address and port.
        // Build a custom OkHttpClient instance, set up a proxy server and add a proxy authenticator (proxyAuthenticator)
        OkHttpClient client = new OkHttpClient().newBuilder().proxy(proxy).proxyAuthenticator((route, response) -> {
            // Generate the credential string for Basic authentication here
            String credential = Credentials.basic("USERNAME-zone-resi-region-us", "PASSWORD");//The "USERNAME-zone-resi-region-us" and "PASSWORD" here should be replaced with proxy username and proxy password.
            // If proxy server needs authentication, please add authentication information in request head.
            return response.request().newBuilder()
                    .header("Proxy-Authorization", credential)
                    .build();
        }).build();

        //Send GET Request and get response
        Request request = new Request.Builder().url(url).build();
        okhttp3.Response response = client.newCall(request).execute();
        //Get and print response
        String responseString = response.body().string();
        System.out.println(responseString);
    }

    /**
     * Socks5 proxy
     */
    public static void testSocks5WithOkHttp() throws IOException {
        //Request URL
        String url = "https://ipinfo.pyproxy.io";
        //Create a SOCKS proxy object and set the actual proxy server host name and port
        Proxy proxy = new Proxy(Proxy.Type.SOCKS, new InetSocketAddress("host", "port"));//The "host" and "port" used here should be replaced with the proxy server address and port.
        //Set the global default authenticator (Authenticator) to handle basic authentication required for all network connections. A username and password are preset here
        java.net.Authenticator.setDefault(new java.net.Authenticator() {
            private PasswordAuthentication authentication =
                    new PasswordAuthentication("account", "password".toCharArray());//The "account" and "port" here should be replaced with proxy username and proxy password.

            @Override
            protected PasswordAuthentication getPasswordAuthentication() 
        });
        //Build an OkHttpClient instance and configure the SOCKS proxy
        OkHttpClient client = new OkHttpClient().newBuilder().proxy(proxy).build();
        //Send GET request and get response
        Request request = new Request.Builder().url(url).build();
        okhttp3.Response response = client.newCall(request).execute();
        //Get and print response
        String responseString = response.body().string();
        System.out.println(responseString);
    }
}
'''
Import thread, time and request package)
to realize multiple thread control, waiting and http request)
'''
import _thread
import time
import requests

# Set request head
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",
}

# Test URL
mainUrl = 'https://ipinfo.pyproxy.io'

def testUrl():
    # Set proxy username and password
    proxy = {
        'http': 'http://USERNAME-zone-resi-region-us:PASSWORD@pr.pyproxy.com:16666',#proxy username:proxy password@proxy server IP:proxy server port
        'https': 'http://USERNAME-zone-resi-region-us:PASSWORD@pr.pyproxy.com:16666',#proxy username:proxy password@proxy server IP:proxy server port
    }
    try:
        res = requests.get(mainUrl, headers=headers, proxies=proxy, timeout=10)
        print(res.status_code, res.text)
    except Exception as e:
        print("Fail to visit", e)
        pass

# Turn on 10 threads to test
for i in range(0, 10):
    _thread.start_new_thread(testUrl, ())
    time.sleep(0.1)

time.sleep(10)
Here is another example of a request that goes through a proxy from London, United Kingdom. Adding region-gb-city-london to the username string enables you to specify a city.
curl -x pr.pyproxy.com:16666 -U "USERNAME-zone-resi-region-gb-city-london:PASSWORD" ipinfo.pyproxy.io
If you need to keep the same proxy for more than one request, use a session control. Add sesssion-abcdef123456 to your username string, where abcdef123456 can be any random string, and as long as you keep sending requests with this string (session ID), you will get the same proxy IP.
curl -x pr.pyproxy.com:16666 -U "USERNAME-zone-resi-session-abcdef123456:PASSWORD" ipinfo.pyproxy.io
Check our integration tutorials with the most popular third party tools, such Adspower , Foxyproxy , or Incogniton.
You can also set up Residential Proxies using the Proxy Generator.
If you have any additional questions, please contact our support team at service@pyproxy.com.
Technical support

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
C/C++
GO
Node.js
PHP
JAVA
Python
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;
}
package main

import (
    "context"
    "fmt"
    "io/ioutil"
    "net"
    "net/http"
    "net/url"
    "strings"
    "time"

    "golang.org/x/net/proxy"
)

// User Pass Auth Setting
var account = "USERNAME-zone-resi"//Proxy_username
var password = "PASSWORD"//Proxy_password

// Proxy server
var proxyServer = "HOST:PORT"//Example:xxx.na.pyproxy.io:2336;

// Test URL
var testApi = "https://ipinfo.pyproxy.io"

func main() {
    go httpProxy(proxyServer, account, password)
    go Socks5Proxy(proxyServer, account, password)

    time.Sleep(time.Minute)
}

// http proxy
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", "response:", 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:", response.Status, string(body))

    return
}

// socks5 proxy
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, "response:", 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】", "response:", string(body))
    }
}
#!/usr/bin/env node
require('request-promise')({
    url: 'https://ipinfo.io',//Request URL
    proxy: 'http://USERNAME-zone-resi:PASSWORD@proxy.pyproxy.io:2333',//proxy username-zone-proxy pool:proxy username@proxy server address
    })
.then(function(data){ console.log(data); },
    function(err){ console.error(err); });
<?php
//User Pass Auth setting
$user = "USERNAME-zone-resi";//Proxy_username
$password = "PASSWORD";//Proxy_password
// Target URL
$targetUrl = "http://google.com";
// Proxy server
$proxyServer = "proxy address";  //Example:xxx.na.pyproxy.io:2336;
$proxyUserPwd = "$user:$password";

// Tunnel verification
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $targetUrl);
curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);

// Set proxy server
curl_setopt($ch, CURLOPT_PROXYTYPE, 0); //http
// curl_setopt($ch, CURLOPT_PROXYTYPE, 5); //sock5
curl_setopt($ch, CURLOPT_PROXY, $proxyServer);

// Set tunnel verification information
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);
package demo;

import okhttp3.Credentials;
import okhttp3.OkHttpClient;
import okhttp3.Request;

import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.PasswordAuthentication;
import java.net.Proxy;

/**
 * compile 'com.squareup.okhttp3:okhttp:4.9.3'
 */
class AutProxyJava {
    public static void main(String[] args) throws IOException {
        testWithOkHttp();

        testSocks5WithOkHttp();
    }

    /**
     * http proxy
     */
    public static void testWithOkHttp() throws IOException {
        String url = "https://ipinfo.pyproxy.io";//Request URL
        //Create a proxy object of type HTTP and specify the host name and port number of the proxy server
        Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress("host", "port"));//The "host" and "port" used here should be replaced with the proxy server address and port.
        // Build a custom OkHttpClient instance, set up a proxy server and add a proxy authenticator (proxyAuthenticator)
        OkHttpClient client = new OkHttpClient().newBuilder().proxy(proxy).proxyAuthenticator((route, response) -> {
            // Generate the credential string for Basic authentication here
            String credential = Credentials.basic("USERNAME-zone-resi", "PASSWORD");//The "USERNAME-zone-resi" and "PASSWORD" here should be replaced with proxy username and proxy password.
            // If proxy server needs authentication, please add authentication information in request head.
            return response.request().newBuilder()
                    .header("Proxy-Authorization", credential)
                    .build();
        }).build();

        //Send GET Request and get response
        Request request = new Request.Builder().url(url).build();
        okhttp3.Response response = client.newCall(request).execute();
        //Get and print response
        String responseString = response.body().string();
        System.out.println(responseString);
    }

    /**
     * Socks5 proxy
     */
    public static void testSocks5WithOkHttp() throws IOException {
        //Request URL
        String url = "https://ipinfo.pyproxy.io";
        //Create a SOCKS proxy object and set the actual proxy server host name and port
        Proxy proxy = new Proxy(Proxy.Type.SOCKS, new InetSocketAddress("host", "port"));//The "host" and "port" used here should be replaced with the proxy server address and port.
        //Set the global default authenticator (Authenticator) to handle basic authentication required for all network connections. A username and password are preset here
        java.net.Authenticator.setDefault(new java.net.Authenticator() {
            private PasswordAuthentication authentication =
                    new PasswordAuthentication("account", "password".toCharArray());//The "account" and "port" here should be replaced with proxy username and proxy password.

            @Override
            protected PasswordAuthentication getPasswordAuthentication() 
        });
        //Build an OkHttpClient instance and configure the SOCKS proxy
        OkHttpClient client = new OkHttpClient().newBuilder().proxy(proxy).build();
        //Send GET request and get response
        Request request = new Request.Builder().url(url).build();
        okhttp3.Response response = client.newCall(request).execute();
        //Get and print response
        String responseString = response.body().string();
        System.out.println(responseString);
    }
}
'''
Import thread, time and request package)
to realize multiple thread control, waiting and http request)
'''
import _thread
import time
import requests

# Set request head
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",
}

# Test URL
mainUrl = 'https://ipinfo.pyproxy.io'

def testUrl():
    # Set proxy username and password
    proxy = {
        'http': 'http://USERNAME-zone-resi:PASSWORDpr.pyproxy.com:16666',#proxy username:proxy password@proxy server IP:proxy server port
        'https': 'http://USERNAME-zone-resi:PASSWORD@pr.pyproxy.com:16666',#proxy username:proxy password@proxy server IP:proxy server port
    }
    try:
        res = requests.get(mainUrl, headers=headers, proxies=proxy, timeout=10)
        print(res.status_code, res.text)
    except Exception as e:
        print("Fail to visit", e)
        pass

# Turn on 10 threads to test
for i in range(0, 10):
    _thread.start_new_thread(testUrl, ())
    time.sleep(0.1)

time.sleep(10)
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:
USERNAME-zone-resi-region-us-city-CITY-session-abcdef123456:PASSWORD
USERNAME-zone-resi-region-us-city-CITY-session-abcdef123456-sessTime-10:PASSWORD
Below is a breakdown of the structure:
Query parameters
Parameter Description
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
Technical support

Location Settings

PYPROXY Residential proxy network covers 190+ locations and offers country, city, state, ZIP code, and ASN targeting.
You can find more information on selecting geo-location parameters in the pages listed below:
Country, State, City Mapping:
We use the ipinfo.io database to assign our exit nodes region , st , and city values.
Some other public IP databases may show different locations. In cases where there can not be any location mismatches, please double-check if the location of the assigned proxy is the same on the IP database used by the target website.
If you have any additional questions, please contact our support team at service@pyproxy.com.
Technical support

Country

Adding a region flag to the authorization header enables one to specify which country IP to use to process the request. The value of this parameter is a case insensitive country code in 2-letter. For example, de for Germany, gb for the United Kingdom, and th for Thailand proxy. See the examples for more details.
Here are a few examples of country parameters:
region-us
region-gb
region-br
region-sg
region-ar
Code example
In this example, a query to ipinfo.pyproxy.io is performed from a random IP address from Brazil:
cURL
C/C++
GO
Node.js
PHP
JAVA
Python
curl -x pr.pyproxy.com:16666 -U "USERNAME-zone-resi-region-br: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-region-br: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;
}
package main
    
import (
    "context"
    "fmt"
    "io/ioutil"
    "net"
    "net/http"
    "net/url"
    "strings"
    "time"

    "golang.org/x/net/proxy"
)

// User Pass Auth Setting
var account = "USERNAME-zone-resi-region-br"//Proxy_username
var password = "PASSWORD"//Proxy_password

// Proxy server
var proxyServer = "proxy address"//Example:xxx.na.pyproxy.io:2336;

// Test URL
var testApi = "https://ipinfo.pyproxy.io"

func main() {
    go httpProxy(proxyServer, account, password)
    go Socks5Proxy(proxyServer, account, password)

    time.Sleep(time.Minute)
}

// http proxy
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", "response:", 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:", response.Status, string(body))

    return
}

// socks5 proxy
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, "response:", 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】", "response:", string(body))
    }
}
#!/usr/bin/env node
require('request-promise')({
    url: 'https://ipinfo.io',//Request URL
    proxy: 'http://USERNAME-zone-resi-region-br:PASSWORD@proxy.pyproxy.io:2333',//proxy username-zone-proxy pool:proxy username@proxy server address
    })
.then(function(data){ console.log(data); },
    function(err){ console.error(err); });
<?php
//User Pass Auth setting
$user = "USERNAME-zone-resi-region-br";//Proxy_username
$password = "PASSWORD";//Proxy_password
// Target URL
$targetUrl = "http://google.com";
// Proxy server
$proxyServer = "proxy address";  //Example:xxx.na.pyproxy.io:2336;
$proxyUserPwd = "$user:$password";
                                
// Tunnel verification
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $targetUrl);
curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
                                
// Set proxy server
curl_setopt($ch, CURLOPT_PROXYTYPE, 0); //http
// curl_setopt($ch, CURLOPT_PROXYTYPE, 5); //sock5
curl_setopt($ch, CURLOPT_PROXY, $proxyServer);
                                
// Set tunnel verification information
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);
package demo;
    
import okhttp3.Credentials;
import okhttp3.OkHttpClient;
import okhttp3.Request;

import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.PasswordAuthentication;
import java.net.Proxy;

/**
 * compile 'com.squareup.okhttp3:okhttp:4.9.3'
 */
class AutProxyJava {
    public static void main(String[] args) throws IOException {
        testWithOkHttp();

        testSocks5WithOkHttp();
    }

    /**
     * http proxy
     */
    public static void testWithOkHttp() throws IOException {
        String url = "https://ipinfo.pyproxy.io";//Request URL
        //Create a proxy object of type HTTP and specify the host name and port number of the proxy server
        Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress("host", "port"));//The "host" and "port" used here should be replaced with the proxy server address and port.
        // Build a custom OkHttpClient instance, set up a proxy server and add a proxy authenticator (proxyAuthenticator)
        OkHttpClient client = new OkHttpClient().newBuilder().proxy(proxy).proxyAuthenticator((route, response) -> {
            // Generate the credential string for Basic authentication here
            String credential = Credentials.basic("USERNAME-zone-resi-region-br", "PASSWORD");//The "USERNAME-zone-resi-region-br" and "PASSWORD" here should be replaced with proxy username and proxy password.
            // If proxy server needs authentication, please add authentication information in request head.
            return response.request().newBuilder()
                    .header("Proxy-Authorization", credential)
                    .build();
        }).build();

        //Send GET Request and get response
        Request request = new Request.Builder().url(url).build();
        okhttp3.Response response = client.newCall(request).execute();
        //Get and print response
        String responseString = response.body().string();
        System.out.println(responseString);
    }

    /**
     * Socks5 proxy
     */
    public static void testSocks5WithOkHttp() throws IOException {
        //Request URL
        String url = "https://ipinfo.pyproxy.io";
        //Create a SOCKS proxy object and set the actual proxy server host name and port
        Proxy proxy = new Proxy(Proxy.Type.SOCKS, new InetSocketAddress("host", "port"));//The "host" and "port" used here should be replaced with the proxy server address and port.
        //Set the global default authenticator (Authenticator) to handle basic authentication required for all network connections. A username and password are preset here
        java.net.Authenticator.setDefault(new java.net.Authenticator() {
            private PasswordAuthentication authentication =
                    new PasswordAuthentication("account", "password".toCharArray());//The "account" and "port" here should be replaced with proxy username and proxy password.

            @Override
            protected PasswordAuthentication getPasswordAuthentication() 
        });
        //Build an OkHttpClient instance and configure the SOCKS proxy
        OkHttpClient client = new OkHttpClient().newBuilder().proxy(proxy).build();
        //Send GET request and get response
        Request request = new Request.Builder().url(url).build();
        okhttp3.Response response = client.newCall(request).execute();
        //Get and print response
        String responseString = response.body().string();
        System.out.println(responseString);
    }
}
'''
Import thread, time and request package)
to realize multiple thread control, waiting and http request)
'''
import _thread
import time
import requests

# Set request head
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",
}

# Test URL
mainUrl = 'https://ipinfo.pyproxy.io'

def testUrl():
    # Set proxy username and password
    proxy = {
        'http': 'http://USERNAME-zone-resi-region-br:PASSWORD@pr.pyproxy.com:16666',#proxy username:proxy password@proxy server IP:proxy server port
        'https': 'http://USERNAME-zone-resi-region-br:PASSWORD@pr.pyproxy.com:16666',#proxy username:proxy password@proxy server IP:proxy server port
    }
    try:
        res = requests.get(mainUrl, headers=headers, proxies=proxy, timeout=10)
        print(res.status_code, res.text)
    except Exception as e:
        print("Fail to visit", e)
        pass

# Turn on 10 threads to test
for i in range(0, 10):
    _thread.start_new_thread(testUrl, ())
    time.sleep(0.1)

time.sleep(10)
Find the complete list of country codes by clicking the file below:
Technical support

State

To get a proxy from a specific state or province, add the st flag to the authorization string. For example, st-florida, st-england. Click here for a complete list of US states.
Here are a few examples of valid combinations of country and state parameters:
region-us-st-california
region-gb-st-england
region-th-st-surin
region-hk-st-kowlooncity
region-au-st-victoria
Code example
In this example, a query to ipinfo.pyproxy.io is performed from a random IP address from England, UK:
cURL
C/C++
GO
Node.js
PHP
JAVA
Python
curl -x pr.pyproxy.com:16666 -U "USERNAME-zone-resi-region-gb-st-england: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-region-gb-st-england: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;
}
package main
    
import (
    "context"
    "fmt"
    "io/ioutil"
    "net"
    "net/http"
    "net/url"
    "strings"
    "time"

    "golang.org/x/net/proxy"
)

// User Pass Auth Setting
var account = "USERNAME-zone-resi-region-gb-st-england"//Proxy_username
var password = "PASSWORD"//Proxy_password

// Proxy server
var proxyServer = "proxy address"//Example:xxx.na.pyproxy.io:2336;

// Test URL
var testApi = "https://ipinfo.pyproxy.io"

func main() {
    go httpProxy(proxyServer, account, password)
    go Socks5Proxy(proxyServer, account, password)

    time.Sleep(time.Minute)
}

// http proxy
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", "response:", 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:", response.Status, string(body))

    return
}

// socks5 proxy
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, "response:", 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】", "response:", string(body))
    }
}
#!/usr/bin/env node
require('request-promise')({
    url: 'https://ipinfo.io',//Request URL
    proxy: 'http://USERNAME-zone-resi-region-gb-st-england:PASSWORD@proxy.pyproxy.io:2333',//proxy username-zone-proxy pool:proxy username@proxy server address
    })
.then(function(data){ console.log(data); },
    function(err){ console.error(err); });
<?php
//User Pass Auth setting
$user = "USERNAME-zone-resi-region-gb-st-england:PASSWORD";//Proxy_username
$password = "PASSWORD";//Proxy_password
// Target URL
$targetUrl = "http://google.com";
// Proxy server
$proxyServer = "proxy address";  //Example:xxx.na.pyproxy.io:2336;
$proxyUserPwd = "$user:$password";
                                
// Tunnel verification
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $targetUrl);
curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
                                
// Set proxy server
curl_setopt($ch, CURLOPT_PROXYTYPE, 0); //http
// curl_setopt($ch, CURLOPT_PROXYTYPE, 5); //sock5
curl_setopt($ch, CURLOPT_PROXY, $proxyServer);
                                
// Set tunnel verification information
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);
package demo;
    
import okhttp3.Credentials;
import okhttp3.OkHttpClient;
import okhttp3.Request;

import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.PasswordAuthentication;
import java.net.Proxy;

/**
 * compile 'com.squareup.okhttp3:okhttp:4.9.3'
 */
class AutProxyJava {
    public static void main(String[] args) throws IOException {
        testWithOkHttp();

        testSocks5WithOkHttp();
    }

    /**
     * http proxy
     */
    public static void testWithOkHttp() throws IOException {
        String url = "https://ipinfo.pyproxy.io";//Request URL
        //Create a proxy object of type HTTP and specify the host name and port number of the proxy server
        Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress("host", "port"));//The "host" and "port" used here should be replaced with the proxy server address and port.
        // Build a custom OkHttpClient instance, set up a proxy server and add a proxy authenticator (proxyAuthenticator)
        OkHttpClient client = new OkHttpClient().newBuilder().proxy(proxy).proxyAuthenticator((route, response) -> {
            // Generate the credential string for Basic authentication here
            String credential = Credentials.basic("USERNAME-zone-resi-region-gb-st-england", "PASSWORD");//The "USERNAME-zone-resi-region-gb-st-england" and "PASSWORD" here should be replaced with proxy username and proxy password.
            // If proxy server needs authentication, please add authentication information in request head.
            return response.request().newBuilder()
                    .header("Proxy-Authorization", credential)
                    .build();
        }).build();

        //Send GET Request and get response
        Request request = new Request.Builder().url(url).build();
        okhttp3.Response response = client.newCall(request).execute();
        //Get and print response
        String responseString = response.body().string();
        System.out.println(responseString);
    }

    /**
     * Socks5 proxy
     */
    public static void testSocks5WithOkHttp() throws IOException {
        //Request URL
        String url = "https://ipinfo.pyproxy.io";
        //Create a SOCKS proxy object and set the actual proxy server host name and port
        Proxy proxy = new Proxy(Proxy.Type.SOCKS, new InetSocketAddress("host", "port"));//The "host" and "port" used here should be replaced with the proxy server address and port.
        //Set the global default authenticator (Authenticator) to handle basic authentication required for all network connections. A username and password are preset here
        java.net.Authenticator.setDefault(new java.net.Authenticator() {
            private PasswordAuthentication authentication =
                    new PasswordAuthentication("account", "password".toCharArray());//The "account" and "port" here should be replaced with proxy username and proxy password.

            @Override
            protected PasswordAuthentication getPasswordAuthentication() 
        });
        //Build an OkHttpClient instance and configure the SOCKS proxy
        OkHttpClient client = new OkHttpClient().newBuilder().proxy(proxy).build();
        //Send GET request and get response
        Request request = new Request.Builder().url(url).build();
        okhttp3.Response response = client.newCall(request).execute();
        //Get and print response
        String responseString = response.body().string();
        System.out.println(responseString);
    }
}
'''
Import thread, time and request package)
to realize multiple thread control, waiting and http request)
'''
import _thread
import time
import requests

# Set request head
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",
}

# Test URL
mainUrl = 'https://ipinfo.pyproxy.io'

def testUrl():
    # Set proxy username and password
    proxy = {
        'http': 'http://USERNAME-zone-resi-region-gb-st-england:PASSWORD:Aabc11@pr.pyproxy.com:16666',#proxy username:proxy password@proxy server IP:proxy server port
        'https': 'http://USERNAME-zone-resi-region-gb-st-england:PASSWORD@pr.pyproxy.com:16666',#proxy username:proxy password@proxy server IP:proxy server port
    }
    try:
        res = requests.get(mainUrl, headers=headers, proxies=proxy, timeout=10)
        print(res.status_code, res.text)
    except Exception as e:
        print("Fail to visit", e)
        pass

# Turn on 10 threads to test
for i in range(0, 10):
    _thread.start_new_thread(testUrl, ())
    time.sleep(0.1)

time.sleep(10)
Find the complete list of states and provinces by clicking the file below:
Technical support

City

Add a city parameter to narrow down to city-level targeting. For example, region-us-city-newyorkcity means that a proxy from New York City, USA, will handle the query.
We support most of the cities in the world, yet due to the dynamic nature of Residential Proxies we do not guarantee we will have proxies there at specific moment in time. Most popular cities are well covered.
Here are a few examples of valid combinations of region and city parameters:
region-us-city-phoenix
region-fr-city-paris
region-gb-city-leeds
region-br-city-sãopaulo
region-ae-city-dubai
Code example
In this example, a query to ipinfo.pyproxy.io is performed from a random IP address from New York City, USA:
cURL
C/C++
GO
Node.js
PHP
JAVA
Python
curl -x pr.pyproxy.com:16666 -U "USERNAME-zone-resi-region-us-city-newyorkcity: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-region-us-city-newyorkcity: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;
}
                                    
package main

import (
    "context"
    "fmt"
    "io/ioutil"
    "net"
    "net/http"
    "net/url"
    "strings"
    "time"

    "golang.org/x/net/proxy"
)

// User Pass Auth Setting
var account = "USERNAME-zone-resi-region-us-city-newyorkcity"//Proxy_username
var password = "PASSWORD"//Proxy_password

// Proxy server
var proxyServer = "proxy address"//Example:xxx.na.pyproxy.io:2336;

// Test URL
var testApi = "https://ipinfo.pyproxy.io"

func main() {
    go httpProxy(proxyServer, account, password)
    go Socks5Proxy(proxyServer, account, password)

    time.Sleep(time.Minute)
}

// http proxy
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", "response:", 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:", response.Status, string(body))

    return
}

// socks5 proxy
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, "response:", 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】", "response:", string(body))
    }
}
#!/usr/bin/env node
require('request-promise')({
    url: 'https://ipinfo.io',//Request URL
    proxy: 'http://USERNAME-zone-resi-region-us-city-newyorkcity:PASSWORD@proxy.pyproxy.io:2333',//proxy username-zone-proxy pool:proxy username@proxy server address
    })
.then(function(data){ console.log(data); },
    function(err){ console.error(err); });
                                    
<?php
//User Pass Auth setting
$user = "USERNAME-zone-resi-region-us-city-newyorkcity";//Proxy_username
$password = "PASSWORD";//Proxy_password
// Target URL
$targetUrl = "http://google.com";
// Proxy server
$proxyServer = "proxy address";  //Example:xxx.na.pyproxy.io:2336;
$proxyUserPwd = "$user:$password";
                                
// Tunnel verification
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $targetUrl);
curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
                                
// Set proxy server
curl_setopt($ch, CURLOPT_PROXYTYPE, 0); //http
// curl_setopt($ch, CURLOPT_PROXYTYPE, 5); //sock5
curl_setopt($ch, CURLOPT_PROXY, $proxyServer);
                                
// Set tunnel verification information
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);
package demo;
    
import okhttp3.Credentials;
import okhttp3.OkHttpClient;
import okhttp3.Request;

import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.PasswordAuthentication;
import java.net.Proxy;

/**
 * compile 'com.squareup.okhttp3:okhttp:4.9.3'
 */
class AutProxyJava {
    public static void main(String[] args) throws IOException {
        testWithOkHttp();

        testSocks5WithOkHttp();
    }

    /**
     * http proxy
     */
    public static void testWithOkHttp() throws IOException {
        String url = "https://ipinfo.pyproxy.io";//Request URL
        //Create a proxy object of type HTTP and specify the host name and port number of the proxy server
        Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress("host", "port"));//The "host" and "port" used here should be replaced with the proxy server address and port.
        // Build a custom OkHttpClient instance, set up a proxy server and add a proxy authenticator (proxyAuthenticator)
        OkHttpClient client = new OkHttpClient().newBuilder().proxy(proxy).proxyAuthenticator((route, response) -> {
            // Generate the credential string for Basic authentication here
            String credential = Credentials.basic("USERNAME-zone-resi-region-us-city-newyorkcity", "PASSWORD");//The "USERNAME-zone-resi-region-us-city-newyorkcity" and "PASSWORD" here should be replaced with proxy username and proxy password.
            // If proxy server needs authentication, please add authentication information in request head.
            return response.request().newBuilder()
                    .header("Proxy-Authorization", credential)
                    .build();
        }).build();

        //Send GET Request and get response
        Request request = new Request.Builder().url(url).build();
        okhttp3.Response response = client.newCall(request).execute();
        //Get and print response
        String responseString = response.body().string();
        System.out.println(responseString);
    }

    /**
     * Socks5 proxy
     */
    public static void testSocks5WithOkHttp() throws IOException {
        //Request URL
        String url = "https://ipinfo.pyproxy.io";
        //Create a SOCKS proxy object and set the actual proxy server host name and port
        Proxy proxy = new Proxy(Proxy.Type.SOCKS, new InetSocketAddress("host", "port"));//The "host" and "port" used here should be replaced with the proxy server address and port.
        //Set the global default authenticator (Authenticator) to handle basic authentication required for all network connections. A username and password are preset here
        java.net.Authenticator.setDefault(new java.net.Authenticator() {
            private PasswordAuthentication authentication =
                    new PasswordAuthentication("account", "password".toCharArray());//The "account" and "port" here should be replaced with proxy username and proxy password.

            @Override
            protected PasswordAuthentication getPasswordAuthentication() 
        });
        //Build an OkHttpClient instance and configure the SOCKS proxy
        OkHttpClient client = new OkHttpClient().newBuilder().proxy(proxy).build();
        //Send GET request and get response
        Request request = new Request.Builder().url(url).build();
        okhttp3.Response response = client.newCall(request).execute();
        //Get and print response
        String responseString = response.body().string();
        System.out.println(responseString);
    }
}
'''
Import thread, time and request package)
to realize multiple thread control, waiting and http request)
'''
import _thread
import time
import requests

# Set request head
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",
}

# Test URL
mainUrl = 'https://ipinfo.pyproxy.io'

def testUrl():
    # Set proxy username and password
    proxy = {
        'http': 'http://USERNAME-zone-resi-region-us-city-newyorkcity:PASSWORD@pr.pyproxy.com:16666',#proxy username:proxy password@proxy server IP:proxy server port
        'https': 'http://USERNAME-zone-resi-region-us-city-newyorkcity:PASSWORD@pr.pyproxy.com:16666',#proxy username:proxy password@proxy server IP:proxy server port
    }
    try:
        res = requests.get(mainUrl, headers=headers, proxies=proxy, timeout=10)
        print(res.status_code, res.text)
    except Exception as e:
        print("Fail to visit", e)
        pass

# Turn on 10 threads to test
for i in range(0, 10):
    _thread.start_new_thread(testUrl, ())
    time.sleep(0.1)

time.sleep(10)
Find the complete list of country codes by clicking the file below:
Technical support

ASN Targeting

Our Residential Proxies support targeting by ASN number which means that you can choose proxies from specific carriers. You have to enter the required ASN number in your request. Below is the example for AT&T Corp., its ASN number in the US being 6389:
cURL
C/C++
GO
Node.js
PHP
JAVA
Python
curl -x a5bb901cab290ae4.wpu.as.pyproxy.io:16666 -U "USERNAME-zone-resi-region-us-asn-AS6389: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-region-us-asn-AS6389: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;
}
package main
    
import (
    "context"
    "fmt"
    "io/ioutil"
    "net"
    "net/http"
    "net/url"
    "strings"
    "time"

    "golang.org/x/net/proxy"
)

// User Pass Auth Setting
var account = "USERNAME-zone-resi-region-us-asn-AS6389"//Proxy_username
var password = "PASSWORD"//Proxy_password

// Proxy server
var proxyServer = "proxy address"//Example:xxx.na.pyproxy.io:2336;

// Test URL
var testApi = "https://ipinfo.pyproxy.io"

func main() {
    go httpProxy(proxyServer, account, password)
    go Socks5Proxy(proxyServer, account, password)

    time.Sleep(time.Minute)
}

// http proxy
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", "response:", 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:", response.Status, string(body))

    return
}

// socks5 proxy
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, "response:", 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】", "response:", string(body))
    }
}
                                    
#!/usr/bin/env node
require('request-promise')({
    url: 'https://ipinfo.io',//Request URL
    proxy: 'http://USERNAME-zone-resi-region-us-asn-AS6389:PASSWORD@proxy.pyproxy.io:2333',//proxy username-zone-proxy pool:proxy username@proxy server address
    })
.then(function(data){ console.log(data); },
    function(err){ console.error(err); });
<?php
//User Pass Auth setting
$user = "USERNAME-zone-resi-region-us-asn-AS6389";//Proxy_username
$password = "PASSWORD";//Proxy_password
// Target URL
$targetUrl = "http://google.com";
// Proxy server
$proxyServer = "proxy address";  //Example:xxx.na.pyproxy.io:2336;
$proxyUserPwd = "$user:$password";
                                
// Tunnel verification
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $targetUrl);
curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
                                
// Set proxy server
curl_setopt($ch, CURLOPT_PROXYTYPE, 0); //http
// curl_setopt($ch, CURLOPT_PROXYTYPE, 5); //sock5
curl_setopt($ch, CURLOPT_PROXY, $proxyServer);
                                
// Set tunnel verification information
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);
package demo;
    
import okhttp3.Credentials;
import okhttp3.OkHttpClient;
import okhttp3.Request;

import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.PasswordAuthentication;
import java.net.Proxy;

/**
 * compile 'com.squareup.okhttp3:okhttp:4.9.3'
 */
class AutProxyJava {
    public static void main(String[] args) throws IOException {
        testWithOkHttp();

        testSocks5WithOkHttp();
    }

    /**
     * http proxy
     */
    public static void testWithOkHttp() throws IOException {
        String url = "https://ipinfo.pyproxy.io";//Request URL
        //Create a proxy object of type HTTP and specify the host name and port number of the proxy server
        Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress("host", "port"));//The "host" and "port" used here should be replaced with the proxy server address and port.
        // Build a custom OkHttpClient instance, set up a proxy server and add a proxy authenticator (proxyAuthenticator)
        OkHttpClient client = new OkHttpClient().newBuilder().proxy(proxy).proxyAuthenticator((route, response) -> {
            // Generate the credential string for Basic authentication here
            String credential = Credentials.basic("USERNAME-zone-resi-region-us-asn-AS6389", "PASSWORD");//The "USERNAME-zone-resi-region-us-asn-AS6389" and "PASSWORD" here should be replaced with proxy username and proxy password.
            // If proxy server needs authentication, please add authentication information in request head.
            return response.request().newBuilder()
                    .header("Proxy-Authorization", credential)
                    .build();
        }).build();

        //Send GET Request and get response
        Request request = new Request.Builder().url(url).build();
        okhttp3.Response response = client.newCall(request).execute();
        //Get and print response
        String responseString = response.body().string();
        System.out.println(responseString);
    }

    /**
     * Socks5 proxy
     */
    public static void testSocks5WithOkHttp() throws IOException {
        //Request URL
        String url = "https://ipinfo.pyproxy.io";
        //Create a SOCKS proxy object and set the actual proxy server host name and port
        Proxy proxy = new Proxy(Proxy.Type.SOCKS, new InetSocketAddress("host", "port"));//The "host" and "port" used here should be replaced with the proxy server address and port.
        //Set the global default authenticator (Authenticator) to handle basic authentication required for all network connections. A username and password are preset here
        java.net.Authenticator.setDefault(new java.net.Authenticator() {
            private PasswordAuthentication authentication =
                    new PasswordAuthentication("account", "password".toCharArray());//The "account" and "port" here should be replaced with proxy username and proxy password.

            @Override
            protected PasswordAuthentication getPasswordAuthentication() 
        });
        //Build an OkHttpClient instance and configure the SOCKS proxy
        OkHttpClient client = new OkHttpClient().newBuilder().proxy(proxy).build();
        //Send GET request and get response
        Request request = new Request.Builder().url(url).build();
        okhttp3.Response response = client.newCall(request).execute();
        //Get and print response
        String responseString = response.body().string();
        System.out.println(responseString);
    }
}
'''
Import thread, time and request package)
to realize multiple thread control, waiting and http request)
'''
import _thread
import time
import requests

# Set request head
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",
}

# Test URL
mainUrl = 'https://ipinfo.pyproxy.io'

def testUrl():
    # Set proxy username and password
    proxy = {
        'http': 'http://USERNAME-zone-resi-region-us-asn-AS6389:PASSWORD@pr.pyproxy.com:16666',#proxy username:proxy password@proxy server IP:proxy server port
        'https': 'http://USERNAME-zone-resi-region-us-asn-AS6389:PASSWORD@pr.pyproxy.com:16666',#proxy username:proxy password@proxy server IP:proxy server port
    }
    try:
        res = requests.get(mainUrl, headers=headers, proxies=proxy, timeout=10)
        print(res.status_code, res.text)
    except Exception as e:
        print("Fail to visit", e)
        pass

# Turn on 10 threads to test
for i in range(0, 10):
    _thread.start_new_thread(testUrl, ())
    time.sleep(0.1)

time.sleep(10)
You can find ASN numbers here
Residential Proxies pool is dynamic in its nature so if there are no IPs under that specific ASN at that moment, you will receive error response. In such case, you should try another ASN number.
You can use either Country or ASN parameter per each request. If both location parameters are used, only Country parameter will be applied.
Technical support

Server Specific Entry Nodes

PYPROXY residential network has three relay servers. You can choose the one which is geographically near the IP address which you want to use. This will make it faster for the servers to receive and send requests.
Here're the servers and their locations.
North America: pr-na.pyproxy.com:16666
Asia: pr-as.pyproxy.com:16666
Europe: pr-eu.pyproxy.com:16666
Code example
In this example, we want to use a USA proxy, so we choose North America server to use. This will shorten the distance between the IP and the server, making it faster to transferring data.
curl -x pr-na.pyproxy.com:16666 -U "USERNAME-zone-resi-region-us:PASSWORD" ipinfo.pyproxy.io
Technical support

Session Control

Establishing session
The session ID parameter allows you to keep the same IP address to run multiple requests. To reuse the same IP multiple times, use sessid parameter after username with randomly created alphanumeric string, for example, session-abcdef123456.
The standard session time is 5 minutes or up to 60s of inactivity (no requests). After that, a new IP address is assigned automatically. To adjust desired session time please refer to Session time
For example, your initial query with session-abcdef123456 assigned proxy IP address 1.1.1.1. As long as you keep sending new requests with the same session ID and that IP address is online and available, the system will route your queries through 1.1.1.1. If you stop sending requests for 60 seconds or the IP address is no longer online, the system will assign a new proxy IP. Your next query with session-abcdef123456 will be routed through a different IP address e.g. 1.1.1.2.
Credentials list example
Example represents a list of credentials that establish different sessions.
USERNAME-zone-resi-session-vtx8ty6jbayl:PASSWORD
USERNAME-zone-resi-session-rft8v5nkac39:PASSWORD
USERNAME-zone-resi-session-zq7q70siprgy:PASSWORD
USERNAME-zone-resi-session-5vez4aip1bpu:PASSWORD
USERNAME-zone-resi-session-riy98jftewmx:PASSWORD
Code example
In this example we are using Spain IP with session-abcdef123456 in the username with the first request. All following requests will keep the same Spain IP with further queries:
cURL
C/C++
GO
Node.js
PHP
JAVA
Python
curl -x pr.pyproxy.com:16666 -U "USERNAME-zone-resi-region-es-session-abcdef123456: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-region-es-session-abcdef123456: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;
}
package main
    
import (
    "context"
    "fmt"
    "io/ioutil"
    "net"
    "net/http"
    "net/url"
    "strings"
    "time"

    "golang.org/x/net/proxy"
)

// User Pass Auth Setting
var account = "USERNAME-zone-resi-region-es-session-abcdef123456"//Proxy_username
var password = "PASSWORD"//Proxy_password

// Proxy server
var proxyServer = "HOST:PORT"//Example:xxx.na.pyproxy.io:2336;

// Test URL
var testApi = "https://ipinfo.pyproxy.io"

func main() {
    go httpProxy(proxyServer, account, password)
    go Socks5Proxy(proxyServer, account, password)

    time.Sleep(time.Minute)
}

// http proxy
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", "response:", 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:", response.Status, string(body))

    return
}

// socks5 proxy
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, "response:", 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】", "response:", string(body))
    }
}
#!/usr/bin/env node
require('request-promise')({
    url: 'https://ipinfo.io',//Request URL
    proxy: 'http://USERNAME-zone-resi-region-es-session-abcdef123456:PASSWORD@proxy.pyproxy.io:2333',//proxy username-zone-proxy pool:proxy username@proxy server address
    })
.then(function(data){ console.log(data); },
    function(err){ console.error(err); });
<?php
//User Pass Auth setting
$user = "USERNAME-zone-resi-region-es-session-abcdef123456";//Proxy_username
$password = "PASSWORD";//Proxy_password
// Target URL
$targetUrl = "http://google.com";
// Proxy server
$proxyServer = "proxy address";  //Example:xxx.na.pyproxy.io:2336;
$proxyUserPwd = "$user:$password";
                                
// Tunnel verification
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $targetUrl);
curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
                                
// Set proxy server
curl_setopt($ch, CURLOPT_PROXYTYPE, 0); //http
// curl_setopt($ch, CURLOPT_PROXYTYPE, 5); //sock5
curl_setopt($ch, CURLOPT_PROXY, $proxyServer);
                                
// Set tunnel verification information
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);
package demo;
    
import okhttp3.Credentials;
import okhttp3.OkHttpClient;
import okhttp3.Request;

import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.PasswordAuthentication;
import java.net.Proxy;

/**
 * compile 'com.squareup.okhttp3:okhttp:4.9.3'
 */
class AutProxyJava {
    public static void main(String[] args) throws IOException {
        testWithOkHttp();

        testSocks5WithOkHttp();
    }

    /**
     * http proxy
     */
    public static void testWithOkHttp() throws IOException {
        String url = "https://ipinfo.pyproxy.io";//Request URL
        //Create a proxy object of type HTTP and specify the host name and port number of the proxy server
        Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress("host", "port"));//The "host" and "port" used here should be replaced with the proxy server address and port.
        // Build a custom OkHttpClient instance, set up a proxy server and add a proxy authenticator (proxyAuthenticator)
        OkHttpClient client = new OkHttpClient().newBuilder().proxy(proxy).proxyAuthenticator((route, response) -> {
            // Generate the credential string for Basic authentication here
            String credential = Credentials.basic("USERNAME-zone-resi-region-es-session-abcdef123456", "PASSWORD");//The "USERNAME-zone-resi-region-es-session-abcdef123456" and "PASSWORD" here should be replaced with proxy username and proxy password.
            // If proxy server needs authentication, please add authentication information in request head.
            return response.request().newBuilder()
                    .header("Proxy-Authorization", credential)
                    .build();
        }).build();

        //Send GET Request and get response
        Request request = new Request.Builder().url(url).build();
        okhttp3.Response response = client.newCall(request).execute();
        //Get and print response
        String responseString = response.body().string();
        System.out.println(responseString);
    }

    /**
     * Socks5 proxy
     */
    public static void testSocks5WithOkHttp() throws IOException {
        //Request URL
        String url = "https://ipinfo.pyproxy.io";
        //Create a SOCKS proxy object and set the actual proxy server host name and port
        Proxy proxy = new Proxy(Proxy.Type.SOCKS, new InetSocketAddress("host", "port"));//The "host" and "port" used here should be replaced with the proxy server address and port.
        //Set the global default authenticator (Authenticator) to handle basic authentication required for all network connections. A username and password are preset here
        java.net.Authenticator.setDefault(new java.net.Authenticator() {
            private PasswordAuthentication authentication =
                    new PasswordAuthentication("account", "password".toCharArray());//The "account" and "port" here should be replaced with proxy username and proxy password.

            @Override
            protected PasswordAuthentication getPasswordAuthentication() 
        });
        //Build an OkHttpClient instance and configure the SOCKS proxy
        OkHttpClient client = new OkHttpClient().newBuilder().proxy(proxy).build();
        //Send GET request and get response
        Request request = new Request.Builder().url(url).build();
        okhttp3.Response response = client.newCall(request).execute();
        //Get and print response
        String responseString = response.body().string();
        System.out.println(responseString);
    }
}
'''
Import thread, time and request package)
to realize multiple thread control, waiting and http request)
'''
import _thread
import time
import requests

# Set request head
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",
}

# Test URL
mainUrl = 'https://ipinfo.pyproxy.io'

def testUrl():
    # Set proxy username and password
    proxy = {
        'http': 'http://USERNAME-zone-resi-region-es-session-abcdef123456:PASSWORD@pr.pyproxy.com:16666',#proxy username:proxy password@proxy server IP:proxy server port
        'https': 'http://USERNAME-zone-resi-region-es-session-abcdef123456:PASSWORD@pr.pyproxy.com:16666',#proxy username:proxy password@proxy server IP:proxy server port
    }
    try:
        res = requests.get(mainUrl, headers=headers, proxies=proxy, timeout=10)
        print(res.status_code, res.text)
    except Exception as e:
        print("Fail to visit", e)
        pass

# Turn on 10 threads to test
for i in range(0, 10):
    _thread.start_new_thread(testUrl, ())
    time.sleep(0.1)

time.sleep(10)
Session time
The sessTime parameter goes together with session, and allows you to prolong the session above 5 minutes or set a particular time for it. This parameter can be set for up to 120 minutes.
Session time parameter does not ensure that all your queries are finished by the end of the session. The session will expire within the time limit set, even if requests are not finished.
Credentials list example:
Example represents a list of credentials that establish different sessions with different session time (minutes).
USERNAME-zone-resi-session-vtx8ty6jbayl-sessTime-5:PASSWORD
USERNAME-zone-resi-session-rft8v5nkac39-sessTime-20:PASSWORD
USERNAME-zone-resi-session-zq7q70siprgy-sessTime-10:PASSWORD
USERNAME-zone-resi-session-5vez4aip1bpu-sessTime-30:PASSWORD
USERNAME-zone-resi-session-riy98jftewmx-sessTime-15:PASSWORD
Code example
We chose the same Spain IP as in the previous example, this time we are adding session string and sessTime parameter for 15 minutes:
cURL
C/C++
GO
Node.js
PHP
JAVA
Python
curl -x pr.pyproxy.com:16666 -U "USERNAME-zone-resi-region-es-session-abcdef123456-sessTime-15: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-region-es-session-abcdef123456-sessTime-15: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;
}
package main
    
import (
    "context"
    "fmt"
    "io/ioutil"
    "net"
    "net/http"
    "net/url"
    "strings"
    "time"

    "golang.org/x/net/proxy"
)

// User Pass Auth Setting
var account = "USERNAME-zone-resi-region-es-session-abcdef123456-sessTime-15"//Proxy_username
var password = "PASSWORD"//Proxy_password

// Proxy server
var proxyServer = "proxy address"//Example:xxx.na.pyproxy.io:2336;

// Test URL
var testApi = "https://ipinfo.pyproxy.io"

func main() {
    go httpProxy(proxyServer, account, password)
    go Socks5Proxy(proxyServer, account, password)

    time.Sleep(time.Minute)
}

// http proxy
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", "response:", 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:", response.Status, string(body))

    return
}

// socks5 proxy
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, "response:", 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】", "response:", string(body))
    }
}
#!/usr/bin/env node
require('request-promise')({
    url: 'https://ipinfo.io',//Request URL
    proxy: 'http://USERNAME-zone-resi-region-es-session-abcdef123456-sessTime-15:PASSWORD@proxy.pyproxy.io:2333',//proxy username-zone-proxy pool:proxy username@proxy server address
    })
.then(function(data){ console.log(data); },
    function(err){ console.error(err); });
<?php
//User Pass Auth setting
$user = "USERNAME-zone-resi-region-es-session-abcdef123456-sessTime-15";//Proxy_username
$password = "PASSWORD";//Proxy_password
// Target URL
$targetUrl = "http://google.com";
// Proxy server
$proxyServer = "proxy address";  //Example:xxx.na.pyproxy.io:2336;
$proxyUserPwd = "$user:$password";
                                
// Tunnel verification
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $targetUrl);
curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
                                
// Set proxy server
curl_setopt($ch, CURLOPT_PROXYTYPE, 0); //http
// curl_setopt($ch, CURLOPT_PROXYTYPE, 5); //sock5
curl_setopt($ch, CURLOPT_PROXY, $proxyServer);
                                
// Set tunnel verification information
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);
package demo;
    
import okhttp3.Credentials;
import okhttp3.OkHttpClient;
import okhttp3.Request;

import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.PasswordAuthentication;
import java.net.Proxy;

/**
 * compile 'com.squareup.okhttp3:okhttp:4.9.3'
 */
class AutProxyJava {
    public static void main(String[] args) throws IOException {
        testWithOkHttp();

        testSocks5WithOkHttp();
    }

    /**
     * http proxy
     */
    public static void testWithOkHttp() throws IOException {
        String url = "https://ipinfo.pyproxy.io";//Request URL
        //Create a proxy object of type HTTP and specify the host name and port number of the proxy server
        Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress("host", "port"));//The "host" and "port" used here should be replaced with the proxy server address and port.
        // Build a custom OkHttpClient instance, set up a proxy server and add a proxy authenticator (proxyAuthenticator)
        OkHttpClient client = new OkHttpClient().newBuilder().proxy(proxy).proxyAuthenticator((route, response) -> {
            // Generate the credential string for Basic authentication here
            String credential = Credentials.basic("USERNAME-zone-resi-region-es-session-abcdef123456-sessTime-15", "PASSWORD");//The "USERNAME-zone-resi-region-es-session-abcdef123456-sessTime-15" and "PASSWORD" here should be replaced with proxy username and proxy password.
            // If proxy server needs authentication, please add authentication information in request head.
            return response.request().newBuilder()
                    .header("Proxy-Authorization", credential)
                    .build();
        }).build();

        //Send GET Request and get response
        Request request = new Request.Builder().url(url).build();
        okhttp3.Response response = client.newCall(request).execute();
        //Get and print response
        String responseString = response.body().string();
        System.out.println(responseString);
    }

    /**
     * Socks5 proxy
     */
    public static void testSocks5WithOkHttp() throws IOException {
        //Request URL
        String url = "https://ipinfo.pyproxy.io";
        //Create a SOCKS proxy object and set the actual proxy server host name and port
        Proxy proxy = new Proxy(Proxy.Type.SOCKS, new InetSocketAddress("host", "port"));//The "host" and "port" used here should be replaced with the proxy server address and port.
        //Set the global default authenticator (Authenticator) to handle basic authentication required for all network connections. A username and password are preset here
        java.net.Authenticator.setDefault(new java.net.Authenticator() {
            private PasswordAuthentication authentication =
                    new PasswordAuthentication("account", "password".toCharArray());//The "account" and "port" here should be replaced with proxy username and proxy password.

            @Override
            protected PasswordAuthentication getPasswordAuthentication() 
        });
        //Build an OkHttpClient instance and configure the SOCKS proxy
        OkHttpClient client = new OkHttpClient().newBuilder().proxy(proxy).build();
        //Send GET request and get response
        Request request = new Request.Builder().url(url).build();
        okhttp3.Response response = client.newCall(request).execute();
        //Get and print response
        String responseString = response.body().string();
        System.out.println(responseString);
    }
}
'''
Import thread, time and request package)
to realize multiple thread control, waiting and http request)
'''
import _thread
import time
import requests

# Set request head
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",
}

# Test URL
mainUrl = 'https://ipinfo.pyproxy.io'

def testUrl():
    # Set proxy username and password
    proxy = {
        'http': 'http://USERNAME-zone-resi-region-es-session-abcdef123456-sessTime-15:PASSWORD@pr.pyproxy.com:16666',#proxy username:proxy password@proxy server IP:proxy server port
        'https': 'http://USERNAME-zone-resi-region-es-session-abcdef123456-sessTime-15:PASSWORD@pr.pyproxy.com:16666',#proxy username:proxy password@proxy server IP:proxy server port
    }
    try:
        res = requests.get(mainUrl, headers=headers, proxies=proxy, timeout=10)
        print(res.status_code, res.text)
    except Exception as e:
        print("Fail to visit", e)
        pass

# Turn on 10 threads to test
for i in range(0, 10):
    _thread.start_new_thread(testUrl, ())
    time.sleep(0.1)

time.sleep(10)
Technical support

Whitelisting IPs

IP whitelisting allows you to access our Residential Proxy pool by simply connecting via whitelisted IPs.
You can only add IPs that are in IPv4 format (xx.xx.xx.xx). Make sure that the IP you are adding is yours and you are not using a Proxy or VPN service at the time.
Create an IP whitelist
To whitelist IP addresses log in to the Dashboard, on the left hand side select Account Settings → IP Whitelist, click on ADD. Select Others and enter IPs in correct format. Click Confirm to submit the list.
rotating_whitelisting
If you want to remove or update the list, click Edit or Delete button in Operate column. If you need more IPs, please get in touch with our customer support team at service@pyproxy.com. IP whitelisting allows you to access our Residential Proxy pool by simply connecting via whitelisted IPs.
Technical support

Proxy Generator

The Proxy Generator is built to help you integrate Residential Proxies effortlessly. Select location and session type parameters, and copy the list of endpoints. If you have already purchased Rotating Residential Proxies, you will find the Proxy Generator by logging in to the Dashboard.
Option Description
Option Description
Country The country or region of the IPs you want to use. Choose global if you don't want to specify the country.
State The state of the IPs you want to use.
City The city of the IPs you want to use.
Users The proxy account you want to use.
Rotation
Randomize IP: IP changes every time you send a request.
Sticky IP: Set a fixed IP duration.
Host:Port Proxy host and port.
Username Proxy username of your proxy credential.
Password Proxy password of your proxy credential. The same as the password of sub-account.
You can choose either region or ISP of the proxies. Remember to choose the country before selecting an ISP.
After setting the parameters of your proxies, choose the proxy format and quantity of IPs to generate your proxy list.
Technical support