By adding the region
flag, you can specify that a certain country's IP be used to handle requests. The value of this parameter is a case-insensitive country code in two-letter 3166-1 alpha-2 format. For example: US
American proxy, GB
British proxy, VN
Vietnam proxy. See the example below for more information.
Here are a few examples of country parameters:
Country / Region
Country / Region Parameter
Code example:
Execute a query to ipinfo.thordata.com
using a random IP address from the United States.
cURL C# PHP Python Java Ruby
Copy curl -x t.pr.thordata.net:12233 -U "user-USERNAME-region-US:PASSWORD" ipinfo.thordata.com
Copy using System ;
using System . Net ;
class Example
{
static void Main ()
{
var client = new WebClient ();
client . Proxy = new WebProxy ( "t.pr.thordata.net:12233" );
client . Proxy . Credentials = new NetworkCredential ( "user-USERNAME-region-US" , "PASSWORD" );
Console . WriteLine ( client . DownloadString ( "https://ipinfo.thordata.com" ));
}
}
Copy <? php
$username = 'USERNAME' ;
$password = 'PASSWORD' ;
$country = 'US' ;
$proxy = 't.pr.thordata.net:12233' ;
$query = curl_init ( 'https://ipinfo.thordata.com' ) ;
curl_setopt ( $query , CURLOPT_RETURNTRANSFER , 1 ) ;
curl_setopt ( $query , CURLOPT_PROXY , "http://$proxy" ) ;
curl_setopt ( $query , CURLOPT_PROXYUSERPWD , "user-$username-region-$country:$password" ) ;
$output = curl_exec ( $query ) ;
curl_close ( $query ) ;
if ($output)
echo $output;
?>
Copy import urllib . request
import random
username = 'USERNAME'
password = 'PASSWORD'
country = 'US'
entry = ( 'http://user- %s -region- %s : %s @t.pr.thordata.net:12233' %
(username , country , password))
query = urllib . request . ProxyHandler ({
'http' : entry,
'https' : entry,
})
execute = urllib . request . build_opener (query)
print (execute. open ( 'https://ipinfo.thordata.com' ). read ())
Copy package example ;
import org . apache . http . HttpHost ;
import org . apache . http . client . fluent . * ;
public class Example {
public static void main ( String [] args) throws Exception {
HttpHost entry = new HttpHost( "t.pr.thordata.net" , 12233 ) ;
String query = Executor . newInstance ()
. auth (entry , "user-USERNAME-region-US" , "PASS" )
. execute ( Request . Get ( "https://ipinfo.thordata.com" ) . viaProxy (entry))
. returnContent () . asString ();
System . out . println (query);
}
}
Copy require 'uri'
require 'net/http'
uri = URI . parse( 'https://ipinfo.thordata.com' )
proxy = Net :: HTTP :: Proxy ( 't.pr.thordata.net' , 12233 , 'user-USERNAME-region-US' , 'PASSWORD' )
req = Net :: HTTP :: Get . new (uri . path)
result = proxy . start(uri . host , uri . port) do | http |
http . request(req)
end
puts result . body