Skip to content

Commit

Permalink
Fix parse clash obfs-local
Browse files Browse the repository at this point in the history
  • Loading branch information
nekohasekai committed Oct 11, 2024
1 parent c6baae3 commit 6b098ba
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions subscription/parser/clash.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,11 +206,11 @@ func (o shadowsocksPluginOptionsBuilder) Build() string {
}

func clashPluginOptions(plugin string, opts map[string]any) string {
options := shadowsocksPluginOptionsBuilder(opts)
options := make(shadowsocksPluginOptionsBuilder)
switch plugin {
case "obfs":
options["mode"] = opts["mode"]
options["host"] = opts["host"]
options["obfs"] = opts["mode"]
options["obfs-host"] = opts["host"]
case "v2ray-plugin":
options["mode"] = opts["mode"]
options["tls"] = opts["tls"]
Expand Down
2 changes: 1 addition & 1 deletion subscription/parser/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ var subscriptionParsers = []func(string) ([]option.Outbound, error){

func ParseSubscription(content string) ([]option.Outbound, error) {
var pErr error
for _, parser := range subscriptionParsers {
for i, parser := range subscriptionParsers {
servers, err := parser(content)
if len(servers) > 0 {
return servers, nil
Expand Down

0 comments on commit 6b098ba

Please sign in to comment.