forked from mirror/serenity
Add template.inbounds
This commit is contained in:
parent
c2f71a1d26
commit
260981ee31
@ -22,6 +22,7 @@
|
|||||||
|
|
||||||
// Inbound
|
// Inbound
|
||||||
|
|
||||||
|
"inbounds": [],
|
||||||
"disable_tun": false,
|
"disable_tun": false,
|
||||||
"disable_system_proxy": false,
|
"disable_system_proxy": false,
|
||||||
"custom_tun": {},
|
"custom_tun": {},
|
||||||
@ -136,6 +137,10 @@ List of [DNS Rule](https://sing-box.sagernet.org/configuration/dns/rule/).
|
|||||||
|
|
||||||
No default traffic bypassing DNS rules will be generated if not empty.
|
No default traffic bypassing DNS rules will be generated if not empty.
|
||||||
|
|
||||||
|
#### inbounds
|
||||||
|
|
||||||
|
List of [Inbound](https://sing-box.sagernet.org/configuration/inbound/).
|
||||||
|
|
||||||
#### disable_tun
|
#### disable_tun
|
||||||
|
|
||||||
Don't generate TUN inbound.
|
Don't generate TUN inbound.
|
||||||
|
@ -27,6 +27,7 @@ type Template struct {
|
|||||||
CustomDNSRules []option.DNSRule `json:"custom_dns_rules,omitempty"`
|
CustomDNSRules []option.DNSRule `json:"custom_dns_rules,omitempty"`
|
||||||
|
|
||||||
// Inbound
|
// Inbound
|
||||||
|
Inbounds []option.Inbound `json:"inbounds,omitempty"`
|
||||||
DisableTUN bool `json:"disable_tun,omitempty"`
|
DisableTUN bool `json:"disable_tun,omitempty"`
|
||||||
DisableSystemProxy bool `json:"disable_system_proxy,omitempty"`
|
DisableSystemProxy bool `json:"disable_system_proxy,omitempty"`
|
||||||
CustomTUN *TypedMessage[option.TunInboundOptions] `json:"custom_tun,omitempty"`
|
CustomTUN *TypedMessage[option.TunInboundOptions] `json:"custom_tun,omitempty"`
|
||||||
|
@ -12,6 +12,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func (t *Template) renderInbounds(metadata M.Metadata, options *option.Options) error {
|
func (t *Template) renderInbounds(metadata M.Metadata, options *option.Options) error {
|
||||||
|
options.Inbounds = t.Inbounds
|
||||||
var needSniff bool
|
var needSniff bool
|
||||||
if !t.DisableTrafficBypass {
|
if !t.DisableTrafficBypass {
|
||||||
needSniff = true
|
needSniff = true
|
||||||
|
Loading…
x
Reference in New Issue
Block a user