mirror of
https://github.com/gravitl/netmaker.git
synced 2025-09-14 00:54:21 +08:00
remove additional port field
This commit is contained in:
parent
60ddad3189
commit
20cf3b00bc
3 changed files with 11 additions and 15 deletions
|
@ -94,10 +94,9 @@ func GetProxyUpdateForHost(ctx context.Context, host *models.Host) (models.Proxy
|
||||||
var found bool
|
var found bool
|
||||||
if currPeerConf, found = peerConfMap[peerHost.PublicKey.String()]; !found {
|
if currPeerConf, found = peerConfMap[peerHost.PublicKey.String()]; !found {
|
||||||
currPeerConf = models.PeerConf{
|
currPeerConf = models.PeerConf{
|
||||||
Proxy: peerHost.ProxyEnabled,
|
Proxy: peerHost.ProxyEnabled,
|
||||||
PublicListenPort: int32(GetPeerListenPort(peerHost)),
|
PublicListenPort: int32(GetPeerListenPort(peerHost)),
|
||||||
ProxyListenPort: GetProxyListenPort(peerHost),
|
ProxyListenPort: GetProxyListenPort(peerHost),
|
||||||
ProxyPublicListenPort: peerHost.PublicListenPort,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -35,15 +35,14 @@ type RelayedConf struct {
|
||||||
|
|
||||||
// PeerConf - struct for peer config in the network
|
// PeerConf - struct for peer config in the network
|
||||||
type PeerConf struct {
|
type PeerConf struct {
|
||||||
Proxy bool `json:"proxy"`
|
Proxy bool `json:"proxy"`
|
||||||
PublicListenPort int32 `json:"public_listen_port"`
|
PublicListenPort int32 `json:"public_listen_port"`
|
||||||
ProxyListenPort int `json:"proxy_listen_port"`
|
ProxyListenPort int `json:"proxy_listen_port"`
|
||||||
ProxyPublicListenPort int `json:"proxy_public_listen_port"`
|
IsExtClient bool `json:"is_ext_client"`
|
||||||
IsExtClient bool `json:"is_ext_client"`
|
Address net.IP `json:"address"`
|
||||||
Address net.IP `json:"address"`
|
ExtInternalIp net.IP `json:"ext_internal_ip"`
|
||||||
ExtInternalIp net.IP `json:"ext_internal_ip"`
|
IsRelayed bool `json:"is_relayed"`
|
||||||
IsRelayed bool `json:"is_relayed"`
|
RelayedTo *net.UDPAddr `json:"relayed_to"`
|
||||||
RelayedTo *net.UDPAddr `json:"relayed_to"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ProxyManagerPayload - struct for proxy manager payload
|
// ProxyManagerPayload - struct for proxy manager payload
|
||||||
|
|
|
@ -88,7 +88,6 @@ func PublishSingleHostPeerUpdate(ctx context.Context, host *models.Host, deleted
|
||||||
if len(peerUpdate.Peers) == 0 { // no peers to send
|
if len(peerUpdate.Peers) == 0 { // no peers to send
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
//if host.ProxyEnabled {
|
|
||||||
proxyUpdate, err := logic.GetProxyUpdateForHost(ctx, host)
|
proxyUpdate, err := logic.GetProxyUpdateForHost(ctx, host)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
@ -96,7 +95,6 @@ func PublishSingleHostPeerUpdate(ctx context.Context, host *models.Host, deleted
|
||||||
proxyUpdate.Server = servercfg.GetServer()
|
proxyUpdate.Server = servercfg.GetServer()
|
||||||
proxyUpdate.Action = models.ProxyUpdate
|
proxyUpdate.Action = models.ProxyUpdate
|
||||||
peerUpdate.ProxyUpdate = proxyUpdate
|
peerUpdate.ProxyUpdate = proxyUpdate
|
||||||
//}
|
|
||||||
|
|
||||||
data, err := json.Marshal(&peerUpdate)
|
data, err := json.Marshal(&peerUpdate)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Add table
Reference in a new issue