mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2026-02-27 01:07:10 +00:00
chore: Cleanup code
This commit is contained in:
@@ -71,10 +71,10 @@ func DialContext(ctx context.Context, network, address string, options ...Option
|
||||
}
|
||||
|
||||
func ListenPacket(ctx context.Context, network, address string, options ...Option) (net.PacketConn, error) {
|
||||
if features.Contains("cmfa") && DefaultSocketHook != nil{
|
||||
if features.CMFA && DefaultSocketHook != nil {
|
||||
return listenPacketHooked(ctx, network, address)
|
||||
}
|
||||
|
||||
|
||||
cfg := applyOptions(options...)
|
||||
|
||||
lc := &net.ListenConfig{}
|
||||
@@ -119,10 +119,10 @@ func GetTcpConcurrent() bool {
|
||||
}
|
||||
|
||||
func dialContext(ctx context.Context, network string, destination netip.Addr, port string, opt *option) (net.Conn, error) {
|
||||
if features.Contains("cmfa") && DefaultSocketHook != nil{
|
||||
if features.CMFA && DefaultSocketHook != nil {
|
||||
return dialContextHooked(ctx, network, destination, port)
|
||||
}
|
||||
|
||||
|
||||
address := net.JoinHostPort(destination.String(), port)
|
||||
|
||||
netDialer := opt.netDialer
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// +build android,cmfa
|
||||
//go:build android && cmfa
|
||||
|
||||
package dialer
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// +build !cmfa
|
||||
//go:build !(android && cmfa)
|
||||
|
||||
package dialer
|
||||
|
||||
|
||||
Reference in New Issue
Block a user