Kho kiến thức / Setup & usage

Using in code

curl, Python and Node.js examples.

Replace host, port, username and password with your own.

curl

bash
curl -x http://user:pass@1.2.3.4:8000 https://api.ipify.org
# SOCKS5
curl -x socks5h://user:pass@1.2.3.4:8000 https://api.ipify.org

Python (requests)

python
import requests
proxy = "http://user:pass@1.2.3.4:8000"
r = requests.get("https://api.ipify.org", proxies={"http": proxy, "https": proxy}, timeout=15)
print(r.text)

For SOCKS5, pip install requests[socks] and use socks5h:// instead of http://.

Node.js

js
import { ProxyAgent, fetch } from "undici";
const agent = new ProxyAgent("http://user:pass@1.2.3.4:8000");
const res = await fetch("https://api.ipify.org", { dispatcher: agent });
console.log(await res.text());
Còn thắc mắc? Gửi ticket, hỗ trợ sẽ trả lời sớm.Liên hệ hỗ trợ →