github.com/ipfans/trojan-go@v0.11.0/proxy/custom/config.go (about) 1 package custom 2 3 import "github.com/ipfans/trojan-go/config" 4 5 const Name = "CUSTOM" 6 7 type NodeConfig struct { 8 Protocol string `json:"protocol" yaml:"protocol"` 9 Tag string `json:"tag" yaml:"tag"` 10 Config interface{} `json:"config" yaml:"config"` 11 } 12 13 type StackConfig struct { 14 Path [][]string `json:"path" yaml:"path"` 15 Node []NodeConfig `json:"node" yaml:"node"` 16 } 17 18 type Config struct { 19 Inbound StackConfig `json:"inbound" yaml:"inbound"` 20 Outbound StackConfig `json:"outbound" yaml:"outbound"` 21 } 22 23 func init() { 24 config.RegisterConfigCreator(Name, func() interface{} { 25 return new(Config) 26 }) 27 }