forked from MetaCubeX/mihomo
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'MetaCubeX:Alpha' into Alpha
- Loading branch information
Showing
139 changed files
with
2,845 additions
and
1,731 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,14 @@ | ||
//go:build !windows | ||
|
||
package inbound | ||
|
||
import ( | ||
"net" | ||
"os" | ||
) | ||
|
||
const SupportNamedPipe = false | ||
|
||
func ListenNamedPipe(path string) (net.Listener, error) { | ||
return nil, os.ErrInvalid | ||
} |
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,32 @@ | ||
package inbound | ||
|
||
import ( | ||
"net" | ||
"os" | ||
|
||
"github.com/metacubex/wireguard-go/ipc/namedpipe" | ||
"golang.org/x/sys/windows" | ||
) | ||
|
||
const SupportNamedPipe = true | ||
|
||
// windowsSDDL is the Security Descriptor set on the namedpipe. | ||
// It provides read/write access to all users and the local system. | ||
const windowsSDDL = "D:PAI(A;OICI;GWGR;;;BU)(A;OICI;GWGR;;;SY)" | ||
|
||
func ListenNamedPipe(path string) (net.Listener, error) { | ||
sddl := os.Getenv("LISTEN_NAMEDPIPE_SDDL") | ||
if sddl == "" { | ||
sddl = windowsSDDL | ||
} | ||
securityDescriptor, err := windows.SecurityDescriptorFromString(sddl) | ||
if err != nil { | ||
return nil, err | ||
} | ||
namedpipeLC := namedpipe.ListenConfig{ | ||
SecurityDescriptor: securityDescriptor, | ||
InputBufferSize: 256 * 1024, | ||
OutputBufferSize: 256 * 1024, | ||
} | ||
return namedpipeLC.Listen(path) | ||
} |
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
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.