An open API service indexing awesome lists of open source software.

https://github.com/mapleafgo/singcast-cli

Dual-Format Proxy Core — Clash & sing-box Config, sing-box Engine
https://github.com/mapleafgo/singcast-cli

clash sing-box

Last synced: about 2 months ago
JSON representation

Dual-Format Proxy Core — Clash & sing-box Config, sing-box Engine

Awesome Lists containing this project

README

          


Singcast

Singcast


Dual-Format Proxy Core — Clash & sing-box Config, sing-box Engine



English | 中文

A lightweight proxy core powered by [sing-box](https://github.com/SagerNet/sing-box). Accepts both **Clash Meta (Mihomo) YAML** and **sing-box JSON** configurations — automatically translating Clash configs at runtime while running everything through the high-performance sing-box engine.

## Features

- **Clash → sing-box Translation** — Automatically converts Mihomo YAML to sing-box JSON at startup
- **Native sing-box JSON** — Also accepts sing-box configs directly, no translation needed
- **Multi-Protocol** — VLESS, VMess, Shadowsocks, Trojan, Hysteria2, TUIC, WireGuard, SOCKS5, HTTP, AnyTLS
- **Auto Routing** — GeoIP/GeoSite-based routing with country detection
- **Daemon Mode** — Background process with PID file and signal-based reload

## CLI

```bash
# Start proxy service
singcast run -c config.yaml

# Run as daemon
singcast run -c config.yaml -d

# With rule-set download proxy
singcast run -c config.yaml -p https://gh-proxy.org

# Translate YAML to sing-box JSON
singcast convert -c config.yaml -o output.json

# Validate config
singcast check -c config.yaml

# Show version
singcast version
```

### `run` Flags

| Flag | Alias | Description |
|------|-------|-------------|
| `--config` | `-c` | Config file path (YAML or JSON) |
| `--daemon` | `-d` | Run as daemon (fork to background) |
| `--api` | | Override external-controller address |
| `--home` | | Home directory (default `~/.singcast`) |
| `--rule-set-proxy` | `-p` | URL prefix for rule-set downloads |

Environment variable `SINGCAST_RULE_SET_PROXY` can also set the rule-set proxy.

### Signals

- `SIGHUP` — Reload config (Unix only)
- `SIGINT` / `SIGTERM` — Graceful shutdown

## Build

[Task](https://taskfile.dev) is required.

```bash
# CLI for current platform
task cli

# CLI for all platforms
task cli-all

# FFI shared library (desktop)
task ffi-darwin-arm64
task ffi-linux-amd64
task ffi-windows-amd64

# FFI shared library (mobile)
task ffi-android-arm64
task ffi-ios-arm64

# All targets
task all
```

Build tags: `with_clash_api,with_utls,with_quic,with_gvisor`

## License

GPL-3.0