forked from MetaCubeX/mihomo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/Beta' into Meta
- Loading branch information
Showing
206 changed files
with
12,859 additions
and
3,366 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
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,29 @@ | ||
package inbound | ||
|
||
import ( | ||
C "github.com/Dreamacro/clash/constant" | ||
) | ||
|
||
type Addition func(metadata *C.Metadata) | ||
|
||
func (a Addition) Apply(metadata *C.Metadata) { | ||
a(metadata) | ||
} | ||
|
||
func WithInName(name string) Addition { | ||
return func(metadata *C.Metadata) { | ||
metadata.InName = name | ||
} | ||
} | ||
|
||
func WithSpecialRules(specialRules string) Addition { | ||
return func(metadata *C.Metadata) { | ||
metadata.SpecialRules = specialRules | ||
} | ||
} | ||
|
||
func WithSpecialProxy(specialProxy string) Addition { | ||
return func(metadata *C.Metadata) { | ||
metadata.SpecialProxy = specialProxy | ||
} | ||
} |
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 inbound | ||
|
||
import ( | ||
"context" | ||
"net" | ||
|
||
"github.com/database64128/tfo-go/v2" | ||
) | ||
|
||
var ( | ||
lc = tfo.ListenConfig{ | ||
DisableTFO: true, | ||
} | ||
) | ||
|
||
func SetTfo(open bool) { | ||
lc.DisableTFO = !open | ||
} | ||
|
||
func ListenContext(ctx context.Context, network, address string) (net.Listener, error) { | ||
return lc.Listen(ctx, network, address) | ||
} | ||
|
||
func Listen(network, address string) (net.Listener, error) { | ||
return ListenContext(context.Background(), network, address) | ||
} |
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
Oops, something went wrong.