Add tor outbound
This commit is contained in:
@@ -17,7 +17,8 @@ type _Outbound struct {
|
||||
VMessOptions VMessOutboundOptions `json:"-"`
|
||||
TrojanOptions TrojanOutboundOptions `json:"-"`
|
||||
WireGuardOptions WireGuardOutboundOptions `json:"-"`
|
||||
HysteriaOutbound HysteriaOutboundOptions `json:"-"`
|
||||
HysteriaOptions HysteriaOutboundOptions `json:"-"`
|
||||
TorOptions TorOutboundOptions `json:"-"`
|
||||
SelectorOptions SelectorOutboundOptions `json:"-"`
|
||||
}
|
||||
|
||||
@@ -43,7 +44,9 @@ func (h Outbound) MarshalJSON() ([]byte, error) {
|
||||
case C.TypeWireGuard:
|
||||
v = h.WireGuardOptions
|
||||
case C.TypeHysteria:
|
||||
v = h.HysteriaOutbound
|
||||
v = h.HysteriaOptions
|
||||
case C.TypeTor:
|
||||
v = h.TorOptions
|
||||
case C.TypeSelector:
|
||||
v = h.SelectorOptions
|
||||
default:
|
||||
@@ -76,7 +79,9 @@ func (h *Outbound) UnmarshalJSON(bytes []byte) error {
|
||||
case C.TypeWireGuard:
|
||||
v = &h.WireGuardOptions
|
||||
case C.TypeHysteria:
|
||||
v = &h.HysteriaOutbound
|
||||
v = &h.HysteriaOptions
|
||||
case C.TypeTor:
|
||||
v = &h.TorOptions
|
||||
case C.TypeSelector:
|
||||
v = &h.SelectorOptions
|
||||
default:
|
||||
|
||||
9
option/tor.go
Normal file
9
option/tor.go
Normal file
@@ -0,0 +1,9 @@
|
||||
package option
|
||||
|
||||
type TorOutboundOptions struct {
|
||||
OutboundDialerOptions
|
||||
ExecutablePath string `json:"executable_path,omitempty"`
|
||||
ExtraArgs []string `json:"extra_args,omitempty"`
|
||||
DataDirectory string `json:"data_directory,omitempty"`
|
||||
Options map[string]string `json:"torrc,omitempty"`
|
||||
}
|
||||
Reference in New Issue
Block a user