From df6318730338bd322ecf750772669c2f8fa0bfea Mon Sep 17 00:00:00 2001 From: Hiddify <114227601+hiddify-com@users.noreply.github.com> Date: Thu, 25 Jan 2024 15:59:48 +0000 Subject: [PATCH] new: add custom outbound --- constant/proxy.go | 1 + option/outbound.go | 3 +++ 2 files changed, 4 insertions(+) diff --git a/constant/proxy.go b/constant/proxy.go index 1e9baee298..327d076820 100644 --- a/constant/proxy.go +++ b/constant/proxy.go @@ -23,6 +23,7 @@ const ( TypeVLESS = "vless" TypeTUIC = "tuic" TypeHysteria2 = "hysteria2" + TypeCustom = "custom" ) const ( diff --git a/option/outbound.go b/option/outbound.go index d2e98ce5c7..5b95cc7bfa 100644 --- a/option/outbound.go +++ b/option/outbound.go @@ -27,6 +27,7 @@ type _Outbound struct { Hysteria2Options Hysteria2OutboundOptions `json:"-"` SelectorOptions SelectorOutboundOptions `json:"-"` URLTestOptions URLTestOutboundOptions `json:"-"` + CustomOptions map[string]interface{} `json:"-"` } type Outbound _Outbound @@ -70,6 +71,8 @@ func (h *Outbound) RawOptions() (any, error) { rawOptionsPtr = &h.SelectorOptions case C.TypeURLTest: rawOptionsPtr = &h.URLTestOptions + case C.TypeCustom: + rawOptionsPtr = &h.CustomOptions case "": return nil, E.New("missing outbound type") default: