Browse Source

add nat type to peer conf

Abhishek Kondur 2 years ago
parent
commit
559880f11d
2 changed files with 10 additions and 12 deletions
  1. 1 2
      logic/peers.go
  2. 9 10
      models/proxy.go

+ 1 - 2
logic/peers.go

@@ -97,8 +97,7 @@ func GetProxyUpdateForHost(ctx context.Context, host *models.Host) (models.Proxy
 					Proxy:            peerHost.ProxyEnabled,
 					PublicListenPort: int32(GetPeerListenPort(peerHost)),
 					ProxyListenPort:  GetProxyListenPort(peerHost),
-					ShouldUseTurn:    peerHost.ShouldUseTurn,
-					TurnRelayAddr:    peerHost.TurnRelayAddr,
+					NatType:          peerHost.NatType,
 				}
 			}
 

+ 9 - 10
models/proxy.go

@@ -35,16 +35,15 @@ type RelayedConf struct {
 
 // PeerConf - struct for peer config in the network
 type PeerConf struct {
-	Proxy            bool           `json:"proxy"`
-	PublicListenPort int32          `json:"public_listen_port"`
-	ProxyListenPort  int            `json:"proxy_listen_port"`
-	IsExtClient      bool           `json:"is_ext_client"`
-	Address          net.IP         `json:"address"`
-	ExtInternalIp    net.IP         `json:"ext_internal_ip"`
-	IsRelayed        bool           `json:"is_relayed"`
-	RelayedTo        *net.UDPAddr   `json:"relayed_to"`
-	ShouldUseTurn    bool           `json:"should_use_turn"`
-	TurnRelayAddr    net.PacketConn `json:"turn_relay_addr"`
+	Proxy            bool         `json:"proxy"`
+	PublicListenPort int32        `json:"public_listen_port"`
+	ProxyListenPort  int          `json:"proxy_listen_port"`
+	IsExtClient      bool         `json:"is_ext_client"`
+	Address          net.IP       `json:"address"`
+	ExtInternalIp    net.IP       `json:"ext_internal_ip"`
+	IsRelayed        bool         `json:"is_relayed"`
+	RelayedTo        *net.UDPAddr `json:"relayed_to"`
+	NatType          string       `json:"nat_type"`
 }
 
 // ProxyManagerPayload - struct for proxy manager payload