Making Requests
Basic Query
To send a request with Halopro, the essentials are your username
and password
. By default, each query will use a randomly assigned IP from Halopro's rotating ISP proxy pool. Every new request results in a different IP address.
Example Query:
In this example, a request is made to ipinfo.halopro.vip using a random IP:
curl -x pr.halopro.vip:7777 -U "USERNAME:PASSWORD" ipinfo.halopro.vip
// 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-custom: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;
}curl -x pr.halopro.com:2333 -U "USERNAME-zone-resi:PASSWORD" ipinfo.halopro.iocurl -x pr.halopro.com:2333 -U "USERNAME-zone-custom-region-br:PASSWORD" ipinfo.halopro.iocurl -x pr.halopro.com:2333 -U "USERNAME-zone-custom-region-gb-st-england:PASSWORD" ipinfo.halopro.iocurl -x pr.halopro.com:2333 -U "USERNAME-zone-custom-city-newyorkcity:PASSWORD" ipinfo.halopro.iocurl -x a5bb901cab290ae4.wpu.as.halopro.io:2333 -U "USERNAME-zone-custom-asn-AS6389:PASSWORD" ipinfo.halopro.iocurl -x pr.halopro.com:2333 -U "USERNAME-zone-custom-region-es-session-abcdef123456:PASSWORD" ipinfo.halopro.iocurl -x pr.halopro.com:7777 -U "USERNAME-region-es-session-abcdef123456-sessTime-15:PASSWORD" ipinfo.halopro.io
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-custom"//Proxy_username
var password = "PASSWORD"//Proxy_password
// Proxy server
var proxyServer = "HOST:PORT"//Example:xxx.na.halopro.io:2336;
// Test URL
var testApi = "https://ipinfo.halopro.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))
}
}curl -x pr.halopro.com:23336 -U "USERNAME-zone-resi:PASSWORD" ipinfo.halopro.iocurl -x pr.halopro.com:23336 -U "USERNAME-zone-custom-region-br:PASSWORD" ipinfo.halopro.iocurl -x pr.halopro.com:23336 -U "USERNAME-zone-custom-region-gb-st-england:PASSWORD" ipinfo.halopro.iocurl -x pr.halopro.com:23336 -U "USERNAME-zone-custom-city-newyorkcity:PASSWORD" ipinfo.halopro.iocurl -x a5bb901cab290ae4.wpu.as.halopro.io:23336 -U "USERNAME-zone-custom-asn-AS6389:PASSWORD" ipinfo.halopro.iocurl -x pr.halopro.com:23336 -U "USERNAME-zone-custom-region-es-session-abcdef123456:PASSWORD" ipinfo.halopro.iocurl -x pr.halopro.com:7777 -U "USERNAME-region-es-session-abcdef123456-sessTime-15:PASSWORD" ipinfo.halopro.io
#!/usr/bin/env node
require('request-promise')({
url: 'https://ipinfo.io',//Request URL
proxy: 'http://USERNAME-zone-custom:PASSWORD@proxy.halopro.io:2333',//proxy username-zone-proxy pool:proxy username@proxy server address
})
.then(function(data){ console.log(data); },
function(err){ console.error(err); });curl -x pr.halopro.com:2333 -U "USERNAME-zone-resi:PASSWORD" ipinfo.halopro.iocurl -x pr.halopro.com:2333 -U "USERNAME-zone-custom-region-br:PASSWORD" ipinfo.halopro.iocurl -x pr.halopro.com:2333 -U "USERNAME-zone-custom-region-gb-st-england:PASSWORD" ipinfo.halopro.iocurl -x pr.halopro.com:2333 -U "USERNAME-zone-custom-city-newyorkcity:PASSWORD" ipinfo.halopro.iocurl -x a5bb901cab290ae4.wpu.as.halopro.io:2333 -U "USERNAME-zone-custom-asn-AS6389:PASSWORD" ipinfo.halopro.iocurl -x pr.halopro.com:2333 -U "USERNAME-zone-custom-region-es-session-abcdef123456:PASSWORD" ipinfo.halopro.iocurl -x pr.halopro.com:7777 -U "USERNAME-region-es-session-abcdef123456-sessTime-15:PASSWORD" ipinfo.halopro.io
<?php
//User Pass Auth setting
$user = "USERNAME-zone-custom";//Proxy_username
$password = "PASSWORD";//Proxy_password
// Target URL
$targetUrl = "http://google.com";
// Proxy server
$proxyServer = "proxy address"; //Example:xxx.na.halopro.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);curl -x pr.halopro.com:2333 -U "USERNAME-zone-resi:PASSWORD" ipinfo.halopro.iocurl -x pr.halopro.com:2333 -U "USERNAME-zone-custom-region-br:PASSWORD" ipinfo.halopro.iocurl -x pr.halopro.com:2333 -U "USERNAME-zone-custom-region-gb-st-england:PASSWORD" ipinfo.halopro.iocurl -x pr.halopro.com:2333 -U "USERNAME-zone-custom-city-newyorkcity:PASSWORD" ipinfo.halopro.iocurl -x a5bb901cab290ae4.wpu.as.halopro.io:2333 -U "USERNAME-zone-custom-asn-AS6389:PASSWORD" ipinfo.halopro.iocurl -x pr.halopro.com:2333 -U "USERNAME-zone-custom-region-es-session-abcdef123456:PASSWORD" ipinfo.halopro.iocurl -x pr.halopro.com:7777 -U "USERNAME-region-es-session-abcdef123456-sessTime-15:PASSWORD" ipinfo.halopro.io
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.halopro.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-custom", "PASSWORD");//The "USERNAME-zone-custom" 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.halopro.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);
}
}curl -x pr.halopro.com:2333 -U "USERNAME-zone-resi:PASSWORD" ipinfo.halopro.iocurl -x pr.halopro.com:2333 -U "USERNAME-zone-custom-region-br:PASSWORD" ipinfo.halopro.iocurl -x pr.halopro.com:2333 -U "USERNAME-zone-custom-region-gb-st-england:PASSWORD" ipinfo.halopro.iocurl -x pr.halopro.com:2333 -U "USERNAME-zone-custom-city-newyorkcity:PASSWORD" ipinfo.halopro.iocurl -x a5bb901cab290ae4.wpu.as.halopro.io:2333 -U "USERNAME-zone-custom-asn-AS6389:PASSWORD" ipinfo.halopro.iocurl -x pr.halopro.com:2333 -U "USERNAME-zone-custom-region-es-session-abcdef123456:PASSWORD" ipinfo.halopro.iocurl -x pr.halopro.com:7777 -U "USERNAME-region-es-session-abcdef123456-sessTime-15:PASSWORD" ipinfo.halopro.io
'''
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.halopro.io'
def testUrl():
# Set proxy username and password
proxy = {
'http': 'http://USERNAME-zone-custom:PASSWORD@pr.halopro.com:2333',#proxy username:proxy password@proxy server IP:proxy server port
'https': 'http://USERNAME-zone-custom:PASSWORD@pr.halopro.com:2333',#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)curl -x pr.halopro.com:2333 -U "USERNAME-zone-resi:PASSWORD" ipinfo.halopro.iocurl -x pr.halopro.com:2333 -U "USERNAME-zone-custom-region-br:PASSWORD" ipinfo.halopro.iocurl -x pr.halopro.com:2333 -U "USERNAME-zone-custom-region-gb-st-england:PASSWORD" ipinfo.halopro.iocurl -x pr.halopro.com:2333 -U "USERNAME-zone-custom-city-newyorkcity:PASSWORD" ipinfo.halopro.iocurl -x a5bb901cab290ae4.wpu.as.halopro.io:2333 -U "USERNAME-zone-custom-asn-AS6389:PASSWORD" ipinfo.halopro.iocurl -x pr.halopro.com:2333 -U "USERNAME-zone-custom-region-es-session-abcdef123456:PASSWORD" ipinfo.halopro.iocurl -x pr.halopro.com:7777 -U "USERNAME-region-es-session-abcdef123456-sessTime-15:PASSWORD" ipinfo.halopro.io
Example Query:
In this example, a request is made to ipinfo.halopro.vip using a random IP:
curl -x proxy.halopro.io:7777 -U "USER:PASS" api.halopro.io
Regional and City-Specific Requests
Halopro allows users to specify a proxy from a specific country or city by adding a parameter to the username. This method also supports session control. Here are some example credentials:
Example:
To use a proxy from the United States, with additional control for sessions or city-level targeting:
USERNAME-region-us-city-CITY:PASSWORD:pr.halopro.vip:7777
USERNAME-region-us-city-CITY-session-123keh4ra-sessTime-5:PASSWORD:pr.halopro.vip:7777
Breakdown of Parameters
Let’s break down the structure of a complete Halopro proxy username:
Structure:
USERNAME-region-us-city-newyork-session-123keh4ra-sessTime-5:PASSWORD:pr.halopro.vip:7777
USER: Your Halopro account username for authentication.
zone-custom: Indicates the residential proxy pool to use.
region-us: A 2-letter country code to restrict proxies to a specific region, e.g., US.
city-newyork: Targets proxies from a specific city, in this case, New York.
session-123keh4ra: Ensures the same IP persists across multiple requests (valid for 5 minutes by default).
sessTime-5: Extends session duration to 5 min (optional,maximum time is 120 min).
PASS: Your Halopro account password.
Query Parameters
username
Proxy account username
zone
Name for IP pool
region
Country/region, random region without this parameter
st
The state you want to specify.
city
The city you want to specify. It can be used without "state" parameter.
session
Required for Sticky IP and switching IPs.Use it when fixing an IP or finding specific IP when switching.
sessTime
Use with session to set IP duration.
password
Proxy account password
Need Help?
If you need further clarification or assistance with location targeting, feel free to contact us via:
Email: service@halopro.com
Live Chat: Available 24/7 Live Chat on our Website.
Last updated