]> Cypherpunks.ru repositories - govpn.git/blobdiff - src/govpn/cmd/govpn-client/main.go
If proxy is specified, then forcefully use TCP protocol for convenience
[govpn.git] / src / govpn / cmd / govpn-client / main.go
index 467bec6545645ac9bde4f06d734d884eeb78dd51..8ebb78dcc95da7c9276e387df69b3be6f5b6c544 100644 (file)
@@ -52,6 +52,7 @@ var (
        timeout     int
        firstUpCall bool = true
        knownPeers  govpn.KnownPeers
+       idsCache    govpn.CipherCache
 )
 
 func main() {
@@ -81,7 +82,7 @@ func main() {
                DSAPub:  pub,
                DSAPriv: priv,
        }
-       govpn.PeersInitDummy(id, conf)
+       idsCache = govpn.NewCipherCache([]govpn.PeerId{*id})
        log.Println(govpn.VersionGet())
 
        tap, err = govpn.TAPListen(*ifaceName)
@@ -107,6 +108,9 @@ MainCycle:
                timeouted := make(chan struct{})
                rehandshaking := make(chan struct{})
                termination := make(chan struct{})
+               if *proxyAddr != "" {
+                       *proto = "tcp"
+               }
                switch *proto {
                case "udp":
                        go startUDP(timeouted, rehandshaking, termination)