CHAN.RUN

Products
Restunnel
Guide
Usage

Proxy Configuration

Proxy Configuration

The hub provides two proxy protocols on localhost. Configure your tools to use either one.

ProtocolDefault AddressUse When
SOCKS5127.0.0.1:1080Most tools support it. Preferred for general use.
HTTP CONNECT127.0.0.1:1081When your tool only supports HTTP proxies.

Environment Variables

The simplest way — set it once, all tools that respect proxy environment variables use it:

export ALL_PROXY=socks5://localhost:1080

Or be more specific:

export HTTP_PROXY=http://localhost:1081
export HTTPS_PROXY=http://localhost:1081

curl

# SOCKS5
curl --proxy socks5://localhost:1080 https://httpbin.org/ip

# HTTP CONNECT
curl --proxy http://localhost:1081 https://httpbin.org/ip

# Named node selection
curl --proxy socks5://vienna-home:x@localhost:1080 https://httpbin.org/ip

Playwright

const browser = await chromium.launch({
  proxy: {
    server: 'socks5://localhost:1080',
  },
});

Or with named node selection:

const browser = await chromium.launch({
  proxy: {
    server: 'socks5://localhost:1080',
    username: 'vienna-home',
    password: 'x',
  },
});

Puppeteer

const browser = await puppeteer.launch({
  args: ['--proxy-server=socks5://localhost:1080'],
});

Python requests

import requests

proxies = {
    'http': 'socks5://localhost:1080',
    'https': 'socks5://localhost:1080',
}

response = requests.get('https://httpbin.org/ip', proxies=proxies)

Requires the requests[socks] extra: pip install requests[socks]

Python aiohttp

from aiohttp_socks import ProxyConnector
import aiohttp

connector = ProxyConnector.from_url('socks5://localhost:1080')
async with aiohttp.ClientSession(connector=connector) as session:
    async with session.get('https://httpbin.org/ip') as response:
        print(await response.json())

Requires aiohttp-socks: pip install aiohttp-socks

Node.js fetch / undici

import { ProxyAgent } from 'undici';

const agent = new ProxyAgent('socks5://localhost:1080');
const response = await fetch('https://httpbin.org/ip', {
  dispatcher: agent,
});

wget

# wget doesn't support SOCKS5 natively — use HTTP CONNECT
https_proxy=http://localhost:1081 wget -qO- https://httpbin.org/ip

Browser (via SSH tunnel)

If you want a browser on your local machine to route through Restunnel, forward the hub's SOCKS5 port over SSH:

ssh -L 1080:127.0.0.1:1080 user@your-server

Then configure your browser to use localhost:1080 as a SOCKS5 proxy. Traffic flows: Browser → SSH tunnel → Restunnel Hub → Exit Node → Internet.