Skip to content

Commit

Permalink
new: add custom outbound
Browse files Browse the repository at this point in the history
  • Loading branch information
hiddify-com committed Jan 25, 2024
1 parent a851289 commit df63187
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions constant/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const (
TypeVLESS = "vless"
TypeTUIC = "tuic"
TypeHysteria2 = "hysteria2"
TypeCustom = "custom"
)

const (
Expand Down
3 changes: 3 additions & 0 deletions option/outbound.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ type _Outbound struct {
Hysteria2Options Hysteria2OutboundOptions `json:"-"`
SelectorOptions SelectorOutboundOptions `json:"-"`
URLTestOptions URLTestOutboundOptions `json:"-"`
CustomOptions map[string]interface{} `json:"-"`
}

type Outbound _Outbound
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit df63187

Please sign in to comment.