chore: support reject proxy type

This commit is contained in:
wwqgtxx
2023-10-11 13:01:14 +08:00
parent 9a16eb2895
commit 4636499439
4 changed files with 41 additions and 24 deletions

View File

@ -120,6 +120,13 @@ func ParseProxy(mapping map[string]any) (C.Proxy, error) {
break
}
proxy = outbound.NewDirectWithOption(*directOption)
case "reject":
rejectOption := &outbound.RejectOption{}
err = decoder.Decode(mapping, rejectOption)
if err != nil {
break
}
proxy = outbound.NewRejectWithOption(*rejectOption)
default:
return nil, fmt.Errorf("unsupport proxy type: %s", proxyType)
}