So, daemonization only works on linux :/

This commit is contained in:
Frank Denis 2018-01-10 19:49:02 +01:00
parent 85a44206e3
commit 3fe60f64c4
3 changed files with 16 additions and 3 deletions

View File

@ -0,0 +1,9 @@
// +build linux
package main
import "github.com/VividCortex/godaemon"
func Daemonize() {
godaemon.MakeDaemon(&godaemon.DaemonAttr{})
}

View File

@ -0,0 +1,6 @@
// +build !linux
package main
func Daemonize() {
}

View File

@ -7,8 +7,6 @@ import (
"net" "net"
"time" "time"
"github.com/VividCortex/godaemon"
"golang.org/x/crypto/curve25519" "golang.org/x/crypto/curve25519"
) )
@ -38,7 +36,7 @@ func main() {
panic(err) panic(err)
} }
if proxy.daemonize { if proxy.daemonize {
godaemon.MakeDaemon(&godaemon.DaemonAttr{}) Daemonize()
} }
proxy.StartProxy() proxy.StartProxy()
} }