1
mirror of https://github.com/jlelse/GoBlog synced 2024-06-02 11:44:27 +00:00

Update tor command options

This commit is contained in:
Jan-Lukas Else 2024-05-13 15:01:58 +02:00
parent 760e467803
commit 48fa07a28c

View File

@ -76,10 +76,17 @@ func StartTor(privateKey ed25519.PrivateKey, remotePort int) (net.Listener, stri
cmd := exec.CommandContext(
context.Background(),
"tor", "--ignore-missing-torrc",
// Hidden Service configs
"--HiddenServiceDir", dir,
"--HiddenServicePort", strconv.Itoa(remotePort)+" "+listener.Addr().String(),
"--HiddenServiceVersion", "3",
"--HiddenServiceEnableIntroDoSDefense", "1",
// Disable SocksPort, we don't need it
"--SocksPort", "0",
// Limit to one process to reduce memory usage
"--NumCPUs", "1",
// Enable hardware acceleration, it might improve speed
"--HardwareAccel", "1",
)
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr