Enable passing in local IP, refactored IP detection (#48)

* Enable passing in local IP, refactored IP detection

* update docker server instructions
This commit is contained in:
David Zhao
2021-07-11 08:42:11 -07:00
committed by GitHub
parent 4c54234954
commit a80e8cf69f
13 changed files with 199 additions and 129 deletions
+8 -2
View File
@@ -35,6 +35,7 @@ type LivekitServer struct {
currentNode routing.LocalNode
running utils.AtomicFlag
doneChan chan struct{}
closedChan chan struct{}
}
func NewLivekitServer(conf *config.Config,
@@ -55,6 +56,7 @@ func NewLivekitServer(conf *config.Config,
// turn server starts automatically
turnServer: turnServer,
currentNode: currentNode,
closedChan: make(chan struct{}),
}
middlewares := []negroni.Handler{
@@ -147,7 +149,8 @@ func (s *LivekitServer) Start() error {
go func() {
values := []interface{}{
"address", s.httpServer.Addr,
"nodeId", s.currentNode.Id,
"node", s.currentNode.Id,
"nodeIP", s.currentNode.Ip,
"version", version.Version,
}
if s.config.RTC.TCPPort != 0 {
@@ -195,6 +198,7 @@ func (s *LivekitServer) Start() error {
s.roomManager.Stop()
close(s.closedChan)
return nil
}
@@ -204,8 +208,10 @@ func (s *LivekitServer) Stop() {
}
s.router.Stop()
s.roomManager.Stop()
close(s.doneChan)
// wait for fully closed
<-s.closedChan
}
func (s *LivekitServer) RoomManager() *RoomManager {