Skip to content

Latest commit

 

History

History
79 lines (58 loc) · 1.73 KB

File metadata and controls

79 lines (58 loc) · 1.73 KB

lesscheck

Proxy connection checker (VLESS/VMess/Shadowsocks/Trojan/WireGuard) in Go. Runs a real test via xray and prints external IP / location / latency, or runs a short speed test.

Please note that this checker is made for personal use, is heavily vibe coded, and may not work well, but as practice shows, it works quite stably. Also, there are hardcoded endpoints in the code that may stop working at some point.

Requirements

  • Go 1.21+
  • xray is available:
    • either in PATH (the xray command)
    • or as /tmp/xray
    • or as $TMPDIR/xray
cp src/xray/xray /tmp/xray && chmod +x /tmp/xray

Build

cd src
go build -o lesscheck .

CLI usage

cd src
./lesscheck <proxy-url> [flags]

Examples:

./lesscheck 'vless://...'
./lesscheck -verbose 'vmess://...'
./lesscheck -speed 'ss://...'
./lesscheck -timeout 30 'trojan://...'
./lesscheck -silent 'wireguard://...'
./lesscheck -ipv6 'vless://...'

Flags:

  • -verbose — verbose output
  • -speed — speed test only (skips IP/location check)
  • -timeout <sec> — timeout (default: 15)
  • -silent — no output (exit code only)
  • -ipv6 — use IPv6 IP-lookup service

Server usage (HTTP API)

Start:

cd src
SERVER_PASSWORD='change_me' ./lesscheck -server -port 8080 -timeout 15

API:

curl -sS -X POST 'http://localhost:8080/check' \
  -H 'Content-Type: application/json' \
  -d '{"password":"change_me","key":"vless://..."}'

curl -sS -X POST 'http://localhost:8080/speed' \
  -H 'Content-Type: application/json' \
  -d '{"password":"change_me","key":"vless://..."}'

Docker

cd src
docker build -t lesscheck .
docker run -d --name lesscheck -e SERVER_PASSWORD='change_me' -p 8080:8080 lesscheck