cparser
A Go library that converts proxy nodes from Clash YAML subscriptions into sing-box option.Outbound values.
Installation
go get github.com/daifiyum/cparser
Usage
package main
import (
"context"
"fmt"
"github.com/daifiyum/cparser"
)
func main() {
source := `proxies:
- name: example
type: ss
server: example.com
port: 8388
cipher: aes-128-gcm
password: example-password
udp: true
`
outbounds, err := cparser.ParseClashSubscription(context.Background(), source)
if err != nil {
panic(err)
}
for _, outbound := range outbounds {
fmt.Println(outbound.Tag, outbound.Type)
}
}
Supported protocols
Supports ss, vmess, vless, trojan, hysteria, hysteria2, and anytls.