Implement STDIOTunnel (#70)

This commit is contained in:
François Guerraz authored and GitHub committed 2023-06-14 03:17:32 +01:00
1 parent edf63253df
commit aa207764b2
4 files changed
+71

No files matched your search

+5
View File
@@ -5,6 +5,7 @@ import (
"log"
"os"
"os/exec"
"syscall"
"github.com/akamensky/argparse"
"github.com/octeep/wireproxy"
@@ -116,6 +117,10 @@ func main() {
return
}
// Wireguard doesn't allow configuring which FD to use for logging
// https://github.com/WireGuard/wireguard-go/blob/master/device/logger.go#L39
// so redirect STDOUT to STDERR, we don't want to print anything to STDOUT anyways
os.Stdout = os.NewFile(uintptr(syscall.Stderr), "/dev/stderr")
logLevel := device.LogLevelVerbose
if *silent {
logLevel = device.LogLevelSilent