Skip to content

[Feature] Support More Proxy Protocols #44

Description

@lurenjiamax

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions