Select the country/region You can select the specified country in the dashboard for proxy access requests. The country code is a case-insensitive parameter in letter 3166-1 alpha-2 format . For example, KR represents the proxy in Germany, GB represents the proxy in the United Kingdom, JP represents the proxy in Japan, and SG represents the proxy in Singapore.
Code example
In this example, a random IP address in Brazil executes a query against ipinfo.io:
curl Python PHP Java C# Ruby
Copy curl -x proxy.abcproxy.com:4950 -U "USERNAME:PASSWORD" ipinfo.io
Copy import urllib . request
import random
username = 'USERNAME'
password = 'PASSWORD'
country = 'DE'
entry = ( 'http:// %s : %s @proxy.abcproxy.com:4950' %
(username , country , password))
query = urllib . request . ProxyHandler ({
'http' : entry,
'https' : entry,
})
execute = urllib . request . build_opener (query)
print (execute. open ( 'https://ipinfo.io' ). read ())
Copy <? php
$username = 'USERNAME' ;
$password = 'PASSWORD' ;
$proxy = 'proxy.abcproxy.com:4950' ;
$query = curl_init ( 'https://ipinfo.io' ) ;
curl_setopt ( $query , CURLOPT_RETURNTRANSFER , 1 ) ;
curl_setopt ( $query , CURLOPT_PROXY , "http://$proxy" ) ;
curl_setopt ( $query , CURLOPT_PROXYUSERPWD , "$username:$password" ) ;
$output = curl_exec ( $query ) ;
curl_close ( $query ) ;
if ($output)
echo $output;
?>
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( "proxy.abcproxy.com" , 4950 ) ;
String query = Executor . newInstance ()
. auth (entry , "USERNAME" , "PASS" )
. execute ( Request . Get ( "http://icanhazip.com" ) . viaProxy (entry))
. returnContent () . asString ();
System . out . println (query);
}
}
Copy using System ;
using System . Net ;
class Example
{
static void Main ()
{
var client = new WebClient ();
client . Proxy = new WebProxy ( "proxy.abcproxy.com:4950" );
client . Proxy . Credentials = new NetworkCredential ( "USERNAME" , "PASSWORD" );
Console . WriteLine ( client . DownloadString ( "https://ipinfo.io" ));
}
}
Copy require 'uri'
require 'net/http'
uri = URI . parse( 'https://ipinfo.io/' )
proxy = Net :: HTTP :: Proxy ( 'proxy.abcproxy.com' , 4950 , '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
If you need any help, please feel free to contact customer service at support@abcproxy.com .