Assume one Janus server is only used by one signaling server / -proxy.

With that, we can notify publisher events locally instead of through NATS
and can remove code that looks up publisher rooms by their ids on Janus.
This commit is contained in:
Joachim Bauch
2021-06-04 14:52:23 +02:00
parent d7bd809c54
commit 9b83993d48
5 changed files with 92 additions and 235 deletions
+2 -5
View File
@@ -88,7 +88,6 @@ type ProxyServer struct {
country string
url string
nats signaling.NatsClient
mcu signaling.Mcu
stopped uint32
@@ -110,7 +109,7 @@ type ProxyServer struct {
clientsLock sync.RWMutex
}
func NewProxyServer(r *mux.Router, version string, config *goconf.ConfigFile, nats signaling.NatsClient) (*ProxyServer, error) {
func NewProxyServer(r *mux.Router, version string, config *goconf.ConfigFile) (*ProxyServer, error) {
hashKey := make([]byte, 64)
if _, err := rand.Read(hashKey); err != nil {
return nil, fmt.Errorf("Could not generate random hash key: %s", err)
@@ -172,8 +171,6 @@ func NewProxyServer(r *mux.Router, version string, config *goconf.ConfigFile, na
version: version,
country: country,
nats: nats,
shutdownChannel: make(chan bool, 1),
upgrader: websocket.Upgrader{
@@ -238,7 +235,7 @@ func (s *ProxyServer) Start(config *goconf.ConfigFile) error {
for {
switch mcuType {
case signaling.McuTypeJanus:
mcu, err = signaling.NewMcuJanus(s.url, config, s.nats)
mcu, err = signaling.NewMcuJanus(s.url, config)
default:
return fmt.Errorf("Unsupported MCU type: %s", mcuType)
}