Feature: support trojan

This commit is contained in:
Dreamacro
2020-03-19 20:26:53 +08:00
parent 230e01f078
commit b562f28c1b
5 changed files with 288 additions and 9 deletions

View File

@ -52,6 +52,13 @@ func ParseProxy(mapping map[string]interface{}) (C.Proxy, error) {
break
}
proxy, err = NewSnell(*snellOption)
case "trojan":
trojanOption := &TrojanOption{}
err = decoder.Decode(mapping, trojanOption)
if err != nil {
break
}
proxy, err = NewTrojan(*trojanOption)
default:
return nil, fmt.Errorf("Unsupport proxy type: %s", proxyType)
}