hide.me Support

How to Use hide.me Socks Proxy in My Script?

Last modified: March 6, 2021

Q: I want to use hide.me SOCKS proxy in my script. How can I do that?

A: Our SOCKS proxy is only available while connected to hide.me VPN. However, connecting to SOCKS proxy (socks.hide.me:1080) does not require authentication. The authentication is already established during the VPN connection.

Since there are many programming languages, we will not list examples for all of them. Instead, we offer examples for some of the most popular, so keep reading if you’re interested.

Please note that our SOCKS proxy is available to our Premium members.

Using SOCKS proxy with curl in shell:

curl -L -x socks5h://socks.hide.me:1080 https://hide-me.nproxy.org/

PHP with curl

PHP supports libcurl library. It allows you to connect with different types of servers using different types of protocols. You can find more information about it here.

$proxy = "socks.hide.me:1080"; 
$url = ‘https://hide-me.nproxy.org’;

$c = curl_init(); 
curl_setopt($c, CURLOPT_URL,$url);
curl_setopt($c, CURLOPT_PROXY, $proxy); 
curl_setopt($c, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5);
curl_setopt($c, CURLOPT_FOLLOWLOCATION, 1); 
curl_setopt($c, CURLOPT_RETURNTRANSFER, 0); 

$curl = curl_exec($c); 
curl_close($c);

Python

Python requires an additional package:
pip install -U requests[socks]

You can find more about the requests[socks] package here.

import requests

hideme_proxy = 'http': "socks5h://socks.hide.me:1080"}
resp = requests.get('https://hide-me.nproxy.org', proxies=hideme_proxy)

Node.js

Node.js also requires some additional packages:
npm install axios socks-proxy-agent

You can find more informations about the packages in the npmjs repository for each respective package.

const axios = require('axios');
const SocksProxyAgent = require('socks-proxy-agent');

const proxyHost = socks.hide.me;
const proxyPort = 1080;
const proxyOptions ='socks5://${proxyHost}:${proxyPort}';
const baseUrl = 'https://hide-me.nproxy.org'

const httpsAgent = new SocksProxyAgent(proxyOptions);

const client   = axios.create(baseUrl, httpsAgent);
const openPage = client.get('/').then(res => res.data);

Additional info:

Using the socks5 scheme causes the DNS resolution to happen on the client, rather than on the proxy server. If you you want to resolve the domains on the proxy server, use socks5h as the scheme. This is in line with curl, which uses the scheme to decide whether to do the DNS resolution on the client or proxy.

hide.me Support
Support Ticket
Contact Support

Open a support request and contact our support directly.

Contact Support
Community
Community

Need help? Have something to share? Let our community know about it.

Visit Community
Setup Guide
Open Setup Guides

We have a detailed step-by-step guide which can help you set up a VPN within minutes.

Open Setup Guide
Christmas Sale

Includes 3 months extra

Days

Hrs

Min

Sec

Get the offer