Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Support More Proxy Protocols #44

Open
lurenjiamax opened this issue Feb 18, 2025 · 0 comments
Open

[Feature] Support More Proxy Protocols #44

lurenjiamax opened this issue Feb 18, 2025 · 0 comments

Comments

@lurenjiamax
Copy link

Currently, serenity use github.com/Dreamacro/clash as ProxyConfig Parser.

https://github.com/SagerNet/serenity/blob/dev/subscription/parser/clash.go#L29

import (
....
	"github.com/Dreamacro/clash/adapter"
	clash_outbound "github.com/Dreamacro/clash/adapter/outbound"
	"github.com/Dreamacro/clash/common/structure"
	"github.com/Dreamacro/clash/config"
	"github.com/Dreamacro/clash/constant"
)

...
func ParseClashSubscription(_ context.Context, content string) ([]option.Outbound, error) {
	config, err := config.UnmarshalRawConfig([]byte(content))
	if err != nil {
		return nil, E.Cause(err, "parse clash config")
	}
	decoder := structure.NewDecoder(structure.Option{TagName: "proxy", WeaklyTypedInput: true})
	var outbounds []option.Outbound
	for i, proxyMapping := range config.Proxy {
		proxy, err := adapter.ParseProxy(proxyMapping)     <--- // Unspported Proxy Type Exception 
		if err != nil {
			return nil, E.Cause(err, "parse proxy ", i)
		}

It will be better to move to github.com/metacubex/mihomo , which supports a lot more modern proxy protocols like: snell, vless, mieru, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant