選擇國家/地區
您可以在儀表板中選擇指定的國家/地區進行代理訪問請求。國家代碼是不區分大小寫的參數,字母 3166-1 alpha-2 格式。比如,KR代表德國的代理,GB代表英國的代理,JP代表日本的代理,SG代表新加坡的代理。
代碼示例
在該示例中,是美国的一個隨機 IP 地址執行對 ipinfo.io 的查詢:
curl -x xxxx.abcproxy.vip:4950 -U "USERNAME:PASSWORD" ipinfo.io
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);
}
}
<?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;
?>
import urllib.request
import random
username = 'USERNAME'
password = 'PASSWORD'
country = 'US'
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())
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"));
}
}
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
如果您需要任何幫助,請隨時通過support@abcproxy.com聯繫客服。
最后更新于