parent
0e03f684b2
commit
fd7838ee58
|
@ -4,6 +4,7 @@ import (
|
|||
"errors"
|
||||
"flag"
|
||||
"fmt"
|
||||
"os"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
|
@ -73,11 +74,16 @@ type BlockNameConfig struct {
|
|||
}
|
||||
|
||||
func ConfigLoad(proxy *Proxy, svcFlag *string, config_file string) error {
|
||||
version := flag.Bool("version", false, "prints current proxy version")
|
||||
configFile := flag.String("config", "dnscrypt-proxy.toml", "path to the configuration file")
|
||||
flag.Parse()
|
||||
if *svcFlag == "stop" || *svcFlag == "uninstall" {
|
||||
return nil
|
||||
}
|
||||
if *version {
|
||||
fmt.Println(AppVersion)
|
||||
os.Exit(0)
|
||||
}
|
||||
config := newConfig()
|
||||
if _, err := toml.DecodeFile(*configFile, &config); err != nil {
|
||||
return err
|
||||
|
|
|
@ -15,6 +15,8 @@ import (
|
|||
"golang.org/x/crypto/curve25519"
|
||||
)
|
||||
|
||||
const AppVersion = "2.0.0beta2"
|
||||
|
||||
type Proxy struct {
|
||||
proxyPublicKey [32]byte
|
||||
proxySecretKey [32]byte
|
||||
|
@ -153,7 +155,7 @@ func (proxy *Proxy) StartProxy() {
|
|||
}
|
||||
liveServers, err := proxy.serversInfo.refresh(proxy)
|
||||
if liveServers > 0 {
|
||||
dlog.Noticef("dnscrypt-proxy is ready - live servers: %d", liveServers)
|
||||
dlog.Noticef("dnscrypt-proxy %s is ready - live servers: %d", AppVersion, liveServers)
|
||||
} else if err != nil {
|
||||
dlog.Error(err)
|
||||
dlog.Notice("dnscrypt-proxy is waiting for at least one server to be reachable")
|
||||
|
|
Loading…
Reference in New Issue