Basic queries only need to pass USERNAME
and PASSWORD
without any other parameters. For a basic query, the request is sent via a random IP address, and a different proxy is used for each new request.
Code example:
In the example below, a query for ipinfo.thordata.com
is executed via a random IP.
cURL C# PHP Python Java Ruby
Copy curl -x t.pr.thordata.net:12233 -U "user-USERNAME: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" , "PASSWORD" );
Console . WriteLine ( client . DownloadString ( "https://ipinfo.thordata.com" ));
}
c
Copy <? php
$username = 'USERNAME' ;
$password = 'PASSWORD' ;
$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:$password" ) ;
$output = curl_exec ( $query ) ;
curl_close ( $query ) ;
if ($output)
echo $output;
?>
Copy import urllib . request
import random
username = 'USERNAME'
password = 'PASSWORD'
entry = ( 'http://user- %s : %s @t.pr.thordata.net:12233' %
(username , 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" , "PASS" )
. execute ( Request . Get ( "http://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' , 4950 , 'user-USERNAME' , 'PASSWORD' )
req = Net :: HTTP :: Get . new (uri . path)
result = proxy . start(uri . host , uri . port) do | http |
http . request(req)
end
puts result . body