Headers

Passing headers

Headers sent through Site Unblocker will be passed directly to the target website.

curl -k -v -x unblock.smartproxy.com:60000 \
     -U "USERNAME:PASSWORD" "https://ip.smartproxy.com/" \
     -H "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.5112.79 Safari/537.36"
     -H "X-Foo: Bar" \ 
import requests

proxies = {
    'http': 'http://USERNAME:[email protected]:60000',
    'https': 'http://USERNAME:[email protected]:60000'
}

headers= {
    'User-Agent':'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.5112.79 Safari/537.36'
    'X-Foo': 'Bar',
}

response = requests.request(
    'GET',
    'https://ip.smartproxy.com/',
    verify=False,
    proxies=proxies,
    headers=headers
)

print(response.text)
import fetch from 'node-fetch';
import createHttpsProxyAgent from 'https-proxy-agent'

const username = 'YOUR_USERNAME';
const password = 'YOUR_PASSWORD';

const agent = createHttpsProxyAgent(
  `http://${username}:${password}@unblock.smartproxy.com:60000`
);

process.env['NODE_TLS_REJECT_UNAUTHORIZED'] = 0;

const headers = {
    'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.5112.79 Safari/537.36'
    'X-Foo': 'Bar',
}

const response = await fetch('https://ip.smartproxy.com/', {
  method: 'get',
  headers: headers,
  agent: agent
});

console.log(await response.text());

Exceptions

The following headers are intercepted by Site Unblocker and are not forwarded to the target website by default:

  • host
  • accept
  • connection
  • cache-control

If you wish to pass any of these headers to the target website, prefix the key of your header with X-SU-Custom-:

curl -k -v -x unblock.smartproxy.com:60000 \
     -U "USERNAME:PASSWORD" "https://ip.smartproxy.com/" \
     -H `X-SU-Custom-Host: spoofed.website.com:8080`
     -H "X-Foo: Bar" \ 

Cookies

The Cookie header does not require any prefix and can be passed directly:

curl -k -v -x unblock.smartproxy.com:60000 \
     -U "USERNAME:PASSWORD" "https://ip.smartproxy.com/" \
     -H "Cookie: WOW=4206969; NICE=8008135"
import requests

proxies = {
    'http': 'http://USERNAME:[email protected]:60000',
    'https': 'http://USERNAME:[email protected]:60000'
}

headers= {
    'Cookie': 'WOW=4206969; NICE=8008135',
  	'X-Smartproxy-Force-User-Cookies: 1',
}

response = requests.request(
    'GET',
    'https://ip.smartproxy.com/',
    verify=False,
    proxies=proxies,
    headers=headers
)

print(response.text)
import fetch from 'node-fetch';
import createHttpsProxyAgent from 'https-proxy-agent'

const username = 'YOUR_USERNAME';
const password = 'YOUR_PASSWORD';

const agent = createHttpsProxyAgent(
  `http://${username}:${password}@unblock.smartproxy.com:60000`
);

process.env['NODE_TLS_REJECT_UNAUTHORIZED'] = 0;

const headers = {
  'Cookie': 'WOW=4206969; NICE=8008135',
  'X-Smartproxy-Force-User-Cookies: 1',
}

const response = await fetch('https://ip.smartproxy.com/', {
  method: 'get',
  headers: headers,
  agent: agent
});

console.log(await response.text());

Forcing headers

Site Unblocker uses predefined header and cookies combinations to achieve the most efficient success rates for targeted websites. This means that, sometimes, we may need to drop customer provided headers in order to improve success rates.

This behaviour, however, can be overridden by forcing headers or cookies.

🚧

When forcing headers or cookies, the request will always be charged from your subscription, even if the request fails.

HeaderValid valuesDescription
X-Force-User-Headers1Force all headers to be forwarded to the target.
X-Force-User-Cookies1Force Cookie to be forwarded to the target