Skip to content

Instantly share code, notes, and snippets.

@vimagick
Last active November 9, 2026 00:22
Show Gist options
  • Select an option

  • Save vimagick/539aadb877f2e7c22ce7e8adc8ec6fd6 to your computer and use it in GitHub Desktop.

Select an option

Save vimagick/539aadb877f2e7c22ce7e8adc8ec6fd6 to your computer and use it in GitHub Desktop.
Deploy free SOCKS5 on katabump.com / bot-hosting.net
image image

Environment -> Add variable

  • PATH=/home/container/.local/bin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

Console -> Shell

cd ~/.local/bin/
curl -sSfL busybox https://github.com/supriyo-biswas/static-builds/releases/download/busybox-minimal-1.38.0/busybox-minimal-1.38.0-linux-x86_64.tar.gz | tar xz bin/busybox --strip 1 && chmod +x busybox && busybox --version
ln -s busybox unzip && unzip --version

curl -sSfLo cloudflared https://github.com/cloudflare/cloudflared/releases/download/2026.10.7/cloudflared-linux-amd64 && chmod +x cloudflared && cloudflared --version
cloudflared tunnel run --token eyJhIjoi********************bCJ9

Caution

cloudflared tunnel doesn't work!

wget https://github.com/v2fly/v2ray-core/releases/download/v5.53.0/v2ray-linux-64.zip
unzip -d v2ray v2ray-linux-64.zip
cd v2ray
chmod +x v2ray
./v2ray --version
touch config.yaml
pip install supervisor
touch supervisord.conf
supervisord -c supervisord.conf
supervisorctl help

Caution

supervisorctl restart failed when websocket break

Settings -> Startup -> Start command

- cd /home/container && if [ -f requirements.txt ]; then pip install --disable-pip-version-check -U --prefix .local -r requirements.txt; fi && exec python3 -u ${STARTUP_FILE}
- cd /home/container/v2ray && ./v2ray test -c config.yaml && exec ./v2ray run -c config.yaml
+ supervisord -nc ~/supervisord.conf

Client

$ sslocal -s $SERVER_HOST:$SERVER_PORT -m chacha20-ietf-poly1305 -k '******' --protocol http -b 0.0.0.0:3128
$ curl -x 127.0.0.1:3128 ipinfo.io

$ sslocal -s $SERVER_HOST:$SERVER_PORT -m chacha20-ietf-poly1305 -k '******' --protocol tunnel -b 0.0.0.0:9001 -f 127.0.0.1:9001
$ curl -u admin:admin 127.0.0.1:9001
#!/usr/bin/env python3
#
# curl -s -x socks5h://$SERVER_HOST:$SERVER_PORT ipinfo.io/json
# curl -s -x socks5h://$SERVER_HOST:$SERVER_PORT 127.0.0.1:9900/stats/summary | jq .
# curl -s -x socks5h://$SERVER_HOST:$SERVER_PORT 127.0.0.1:9900/flows/active | jq .
#
# https://github.com/R0GGER/public-iperf3-servers
# socat TCP4-LISTEN:5201,reuseaddr,fork SOCKS5-CONNECT:$SERVER_HOST:$SERVER_PORT:spd-fisrv.hostkey.com:5201,socksuser=username,sockspass=password
# iperf3 -c 127.0.0.1
#
import os
from asyncio_socks_server import (
FileAuth,
FlowAudit,
FlowStats,
Server,
StatsAPI,
)
from dotenv import load_dotenv
load_dotenv()
auth = FileAuth("users.json")
audit = FlowAudit()
stats = FlowStats()
server = Server(
host="::",
port=int(os.environ.get("SERVER_PORT", 1080)),
auth=("admin", "******"),
addons=[
auth,
audit,
stats,
StatsAPI(stats=stats, audit=audit, host="127.0.0.1", port=9900),
],
)
server.run()
log:
access: /dev/stdout
error: /dev/stderr
loglevel: warning
inbounds:
# https://www.v2ray.com/chapter_02/protocols/shadowsocks.html
- port: env:SERVER_PORT
protocol: shadowsocks
settings:
method: chacha20-ietf-poly1305
password: ******
network: tcp,udp
level: 0
# https://www.v2ray.com/chapter_02/04_dns.html
dns:
hosts:
supervisor.me: 127.0.0.1 # FIXME: IT DOES NOT WORK
servers:
- address: 1.1.1.1
- address: localhost
# https://www.v2ray.com/chapter_02/02_protocols.html
outbounds:
- tag: direct
protocol: freedom
settings: {}
- tag: blocked
protocol: blackhole
settings: {}
- tag: dns-out
protocol: dns
settings: {}
# https://www.v2ray.com/chapter_02/03_routing.html
routing:
domainStrategy: AsIs
rules:
- type: field
port: 53
outboundTag: dns-out
- type: field
network: tcp,udp
outboundTag: direct
SERVER_PORT=20076
asyncio-socks-server
python-dotenv
supervisor
[unix_http_server]
file=/tmp/supervisor.sock
chmod=0700
[supervisord]
pidfile=/tmp/supervisord.pid
logfile=/tmp/supervisord.log
loglevel=info
logfile_maxbytes=50MB
logfile_backups=10
nodaemon=false
directory=/home/container/
[inet_http_server]
port=0.0.0.0:9001
username=admin
password=admin
[supervisorctl]
serverurl=unix:///tmp/supervisor.sock
[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
[program:v2ray]
directory=/home/container/v2ray
command=/home/container/v2ray/v2ray run -c /home/container/v2ray/config.yaml
process_name=%(program_name)s
autostart=true
autorestart=true
startsecs=3
startretries=3
stopsignal=TERM
stopwaitsecs=10
stdout_logfile=/tmp/v2ray_stdout.log
stderr_logfile=/tmp/v2ray_stderr.log
stdout_logfile_maxbytes=10MB
stderr_logfile_maxbytes=10MB
stdout_logfile_backups=3
stderr_logfile_backups=3
{
"username": "password"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment