forked from mirror/serenity
Add subscription.process.rewrite_multiplex
This commit is contained in:
parent
5a3996dad9
commit
7dffc3de5f
@ -12,7 +12,8 @@
|
|||||||
"filter_outbound_type": [],
|
"filter_outbound_type": [],
|
||||||
"exclude_outbound_type": [],
|
"exclude_outbound_type": [],
|
||||||
"rename": {},
|
"rename": {},
|
||||||
"remove_emoji": false
|
"remove_emoji": false,
|
||||||
|
"rewrite_multiplex": {}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"deduplication": false,
|
"deduplication": false,
|
||||||
@ -77,6 +78,10 @@ Regexp rename rules, matching outbounds will be renamed.
|
|||||||
|
|
||||||
Remove emojis in outbound tags.
|
Remove emojis in outbound tags.
|
||||||
|
|
||||||
|
#### process.rewrite_multiplex
|
||||||
|
|
||||||
|
Rewrite [Multiplex](https://sing-box.sagernet.org/configuration/shared/multiplex) options.
|
||||||
|
|
||||||
#### deduplication
|
#### deduplication
|
||||||
|
|
||||||
Remove outbounds with duplicate server destinations (Domain will be resolved to compare).
|
Remove outbounds with duplicate server destinations (Domain will be resolved to compare).
|
||||||
|
@ -68,6 +68,7 @@ type OutboundProcessOptions struct {
|
|||||||
ExcludeOutboundType option.Listable[string] `json:"exclude_outbound_type,omitempty"`
|
ExcludeOutboundType option.Listable[string] `json:"exclude_outbound_type,omitempty"`
|
||||||
Rename *badjson.TypedMap[string, string] `json:"rename,omitempty"`
|
Rename *badjson.TypedMap[string, string] `json:"rename,omitempty"`
|
||||||
RemoveEmoji bool `json:"remove_emoji,omitempty"`
|
RemoveEmoji bool `json:"remove_emoji,omitempty"`
|
||||||
|
RewriteMultiplex *option.OutboundMultiplexOptions `json:"rewrite_multiplex,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type Profile struct {
|
type Profile struct {
|
||||||
|
@ -5,6 +5,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/sagernet/serenity/option"
|
"github.com/sagernet/serenity/option"
|
||||||
|
C "github.com/sagernet/sing-box/constant"
|
||||||
boxOption "github.com/sagernet/sing-box/option"
|
boxOption "github.com/sagernet/sing-box/option"
|
||||||
"github.com/sagernet/sing/common"
|
"github.com/sagernet/sing/common"
|
||||||
E "github.com/sagernet/sing/common/exceptions"
|
E "github.com/sagernet/sing/common/exceptions"
|
||||||
@ -103,6 +104,18 @@ func (o *ProcessOptions) Process(outbounds []boxOption.Outbound) []boxOption.Out
|
|||||||
if originTag != outbound.Tag {
|
if originTag != outbound.Tag {
|
||||||
renameResult[originTag] = outbound.Tag
|
renameResult[originTag] = outbound.Tag
|
||||||
}
|
}
|
||||||
|
if o.RewriteMultiplex != nil {
|
||||||
|
switch outbound.Type {
|
||||||
|
case C.TypeShadowsocks:
|
||||||
|
outbound.ShadowsocksOptions.Multiplex = o.RewriteMultiplex
|
||||||
|
case C.TypeTrojan:
|
||||||
|
outbound.TrojanOptions.Multiplex = o.RewriteMultiplex
|
||||||
|
case C.TypeVMess:
|
||||||
|
outbound.VMessOptions.Multiplex = o.RewriteMultiplex
|
||||||
|
case C.TypeVLESS:
|
||||||
|
outbound.VLESSOptions.Multiplex = o.RewriteMultiplex
|
||||||
|
}
|
||||||
|
}
|
||||||
newOutbounds = append(newOutbounds, outbound)
|
newOutbounds = append(newOutbounds, outbound)
|
||||||
}
|
}
|
||||||
if len(renameResult) > 0 {
|
if len(renameResult) > 0 {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user