Use random NodeID instead of MAC based (#2029)
Makes it possible to run multiple instances of livekit-server locally. Also enables Signal Relay by default as default signal proxy.
This commit is contained in:
+1
-4
@@ -27,10 +27,7 @@ import (
|
||||
type LocalNode *livekit.Node
|
||||
|
||||
func NewLocalNode(conf *config.Config) (LocalNode, error) {
|
||||
nodeID, err := utils.LocalNodeID()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
nodeID := utils.NewGuid(utils.NodePrefix)
|
||||
if conf.RTC.NodeIP == "" {
|
||||
return nil, ErrIPNotSet
|
||||
}
|
||||
|
||||
@@ -212,7 +212,7 @@ func (r *RedisRouter) WriteParticipantRTC(_ context.Context, roomName livekit.Ro
|
||||
return err
|
||||
}
|
||||
|
||||
rtcSink := NewRTCNodeSink(r.rc, livekit.NodeID(rtcNode), livekit.ConnectionID("ephemeral"), pkey, pkeyB62)
|
||||
rtcSink := NewRTCNodeSink(r.rc, livekit.NodeID(rtcNode), "ephemeral", pkey, pkeyB62)
|
||||
msg.ParticipantKey = string(ParticipantKeyLegacy(roomName, identity))
|
||||
msg.ParticipantKeyB62 = string(ParticipantKey(roomName, identity))
|
||||
return r.writeRTCMessage(rtcSink, msg)
|
||||
@@ -229,7 +229,7 @@ func (r *RedisRouter) WriteRoomRTC(ctx context.Context, roomName livekit.RoomNam
|
||||
}
|
||||
|
||||
func (r *RedisRouter) WriteNodeRTC(_ context.Context, rtcNodeID string, msg *livekit.RTCNodeMessage) error {
|
||||
rtcSink := NewRTCNodeSink(r.rc, livekit.NodeID(rtcNodeID), livekit.ConnectionID("ephemeral"), livekit.ParticipantKey(msg.ParticipantKey), livekit.ParticipantKey(msg.ParticipantKeyB62))
|
||||
rtcSink := NewRTCNodeSink(r.rc, livekit.NodeID(rtcNodeID), "ephemeral", livekit.ParticipantKey(msg.ParticipantKey), livekit.ParticipantKey(msg.ParticipantKeyB62))
|
||||
return r.writeRTCMessage(rtcSink, msg)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user