-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3014a63
commit 847e170
Showing
5 changed files
with
54 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package filter | ||
|
||
import ( | ||
"github.com/sagernet/serenity/common/metadata" | ||
"github.com/sagernet/serenity/common/semver" | ||
C "github.com/sagernet/sing-box/constant" | ||
"github.com/sagernet/sing-box/option" | ||
) | ||
|
||
func init() { | ||
filters = append(filters, filter1100) | ||
} | ||
|
||
func filter1100(metadata metadata.Metadata, options *option.Options) { | ||
if metadata.Version == nil || metadata.Version.GreaterThanOrEqual(semver.ParseVersion("1.10.0-alpha.1")) { | ||
return | ||
} | ||
newInbounds := make([]option.Inbound, 0, len(options.Inbounds)) | ||
for _, inbound := range options.Inbounds { | ||
if inbound.Type == C.TypeRedirect && inbound.RedirectOptions.AutoRedirect != nil { | ||
continue | ||
} | ||
newInbounds = append(newInbounds, inbound) | ||
} | ||
options.Inbounds = newInbounds | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters