turn server poc

This commit is contained in:
Abhishek Kondur
2023-03-22 11:00:03 +04:00
parent e17505979a
commit cafdfa70c1
10 changed files with 151 additions and 1 deletions

View File

@@ -11,6 +11,7 @@ import (
"github.com/gravitl/netmaker/logger"
"github.com/gravitl/netmaker/models"
"github.com/gravitl/netmaker/servercfg"
"github.com/gravitl/netmaker/turnserver"
"golang.org/x/crypto/bcrypt"
)
@@ -97,6 +98,7 @@ func CreateHost(h *models.Host) error {
return err
}
h.HostPass = string(hash)
turnserver.RegisterNewHostWithTurn(h.ID.String(), h.HostPass)
// if another server has already updated proxyenabled, leave it alone
if !h.ProxyEnabledSet {
log.Println("checking default proxy", servercfg.GetServerConfig().DefaultProxyMode)