Country
To target a specific country's IP, add the country header to the username. The value should be a case-insensitive 2-letter country code in ISO 3166-1 alpha-2 format, such as DE for Germany, GB for the United Kingdom, and ES for Spain. Example below with more details.
Examples of a few countries that you can target in the country parameter:
Country
Country parameter
United States
country-us
United Kingdom
country-gb
Japan
country-jp
The full list of country abbreviations may be found here: Full Country List
Request example
curl --proxytunnel --proxy "https://customer-USERNAME-country-us:[email protected]" https://ip.goproxies.comnpm install axios https-proxy-agent// country-example.js
const axios = require('axios');
const { HttpsProxyAgent } = require('https-proxy-agent');
const username = 'customer-USERNAME-country-gb'; // e.g. country-gb
const password = 'PASSWORD';
const proxyUrl = `http://${encodeURIComponent(username)}:${encodeURIComponent(password)}@hosting.goproxies.com:1080`;
const agent = new HttpsProxyAgent(proxyUrl);
(async () => {
try {
const res = await axios.get('https://ip.goproxies.com', { httpsAgent: agent, timeout: 10000 });
console.log('status:', res.status);
console.log('body:', res.data);
} catch (err) {
console.error('request error:', err.message);
}
})();# country_example.py
import requests
from urllib.parse import quote
username = "customer-USERNAME-country-jp" # e.g. country-jp
password = "PASSWORD"
proxy = f"http://{quote(username)}:{quote(password)}@hosting.goproxies.com:1080"
proxies = {"http": proxy, "https": proxy}
resp = requests.get("https://ip.goproxies.com", proxies=proxies, timeout=10)
print(resp.status_code)
print(resp.text)package main
import (
"fmt"
"io"
"net/http"
"net/url"
"time"
)
func main() {
proxyURL, _ := url.Parse("http://customer-USERNAME-country-jp:[email protected]:1080") // e.g. country-jp
transport := &http.Transport{
Proxy: http.ProxyURL(proxyURL),
TLSHandshakeTimeout: 10 * time.Second,
}
client := &http.Client{Transport: transport, Timeout: 15 * time.Second}
resp, err := client.Get("https://ip.goproxies.com")
if err != nil {
fmt.Println("request error:", err)
return
}
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println("status:", resp.Status)
fmt.Println(string(body))
}import org.apache.http.HttpHost;
import org.apache.http.auth.AuthScope;
import org.apache.http.auth.UsernamePasswordCredentials;
import org.apache.http.client.CredentialsProvider;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.impl.client.BasicCredentialsProvider;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
public class CountrySharedDatacenter {
public static void main(String[] args) throws Exception {
String proxyHost = "hosting.goproxies.com";
int proxyPort = 1080;
String user = "customer-USERNAME-country-gb"; // e.g. country-gb
String pass = "PASSWORD";
CredentialsProvider credsProvider = new BasicCredentialsProvider();
credsProvider.setCredentials(new AuthScope(proxyHost, proxyPort),
new UsernamePasswordCredentials(user, pass));
HttpHost proxy = new HttpHost(proxyHost, proxyPort);
RequestConfig config = RequestConfig.custom().setProxy(proxy).build();
try (CloseableHttpClient httpclient = HttpClients.custom()
.setDefaultCredentialsProvider(credsProvider)
.build()) {
HttpGet httpget = new HttpGet("https://ip.goproxies.com");
httpget.setConfig(config);
try (CloseableHttpResponse response = httpclient.execute(httpget)) {
System.out.println(response.getStatusLine());
System.out.println(new String(response.getEntity().getContent().readAllBytes()));
}
}
}
}
# country_example.rb
require 'net/http'
require 'uri'
username = 'customer-USERNAME-country-us' # e.g. country-us
password = 'PASSWORD'
uri = URI('https://ip.goproxies.com')
proxy_addr = 'hosting.goproxies.com'
proxy_port = 1080
Net::HTTP::Proxy(proxy_addr, proxy_port, username, password).start(uri.host, uri.port, use_ssl: true) do |http|
req = Net::HTTP::Get.new(uri)
res = http.request(req)
puts res.code
puts res.body
end<?php
// country_example.php
$ch = curl_init('https://ip.goproxies.com');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_PROXY, 'hosting.goproxies.com:1080');
curl_setopt($ch, CURLOPT_PROXYUSERPWD, 'customer-USERNAME-country-us:PASSWORD'); // e.g. country-us
curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, true);
$response = curl_exec($ch);
if ($response === false) {
echo 'cURL error: ' . curl_error($ch) . PHP_EOL;
} else {
echo 'Response: ' . $response . PHP_EOL;
}
curl_close($ch);Last updated
Was this helpful?

