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:
+2
-2
@@ -152,7 +152,7 @@ keys:
|
|||||||
# enable_remote_unmute: true
|
# enable_remote_unmute: true
|
||||||
# # limit size of room and participant's metadata, 0 for no limit
|
# # limit size of room and participant's metadata, 0 for no limit
|
||||||
# max_metadata_size: 0
|
# max_metadata_size: 0
|
||||||
# # control playout delay in ms of video track (and associated audio track)
|
# # control playout delay in ms of video track (and associated audio track)
|
||||||
# playout_delay:
|
# playout_delay:
|
||||||
# enabled: true
|
# enabled: true
|
||||||
# min: 100
|
# min: 100
|
||||||
@@ -171,7 +171,7 @@ keys:
|
|||||||
# since v1.4.0, a more reliable, psrpc based signal relay is available
|
# since v1.4.0, a more reliable, psrpc based signal relay is available
|
||||||
# this gives us the ability to reliably proxy messages between a signal server and RTC node
|
# this gives us the ability to reliably proxy messages between a signal server and RTC node
|
||||||
# signal_relay:
|
# signal_relay:
|
||||||
# # disabled by default. will be enabled by default in future versions
|
# # enabled by default as of v1.5.0, legacy signal proxy will be removed in v1.6
|
||||||
# enabled: true
|
# enabled: true
|
||||||
# # amount of time a message delivery is tried before giving up
|
# # amount of time a message delivery is tried before giving up
|
||||||
# retry_timeout: 30s
|
# retry_timeout: 30s
|
||||||
|
|||||||
@@ -476,7 +476,7 @@ var DefaultConfig = Config{
|
|||||||
CPULoadLimit: 0.9,
|
CPULoadLimit: 0.9,
|
||||||
},
|
},
|
||||||
SignalRelay: SignalRelayConfig{
|
SignalRelay: SignalRelayConfig{
|
||||||
Enabled: false,
|
Enabled: true,
|
||||||
RetryTimeout: 7500 * time.Millisecond,
|
RetryTimeout: 7500 * time.Millisecond,
|
||||||
MinRetryInterval: 500 * time.Millisecond,
|
MinRetryInterval: 500 * time.Millisecond,
|
||||||
MaxRetryInterval: 4 * time.Second,
|
MaxRetryInterval: 4 * time.Second,
|
||||||
|
|||||||
+1
-4
@@ -27,10 +27,7 @@ import (
|
|||||||
type LocalNode *livekit.Node
|
type LocalNode *livekit.Node
|
||||||
|
|
||||||
func NewLocalNode(conf *config.Config) (LocalNode, error) {
|
func NewLocalNode(conf *config.Config) (LocalNode, error) {
|
||||||
nodeID, err := utils.LocalNodeID()
|
nodeID := utils.NewGuid(utils.NodePrefix)
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
if conf.RTC.NodeIP == "" {
|
if conf.RTC.NodeIP == "" {
|
||||||
return nil, ErrIPNotSet
|
return nil, ErrIPNotSet
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -212,7 +212,7 @@ func (r *RedisRouter) WriteParticipantRTC(_ context.Context, roomName livekit.Ro
|
|||||||
return err
|
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.ParticipantKey = string(ParticipantKeyLegacy(roomName, identity))
|
||||||
msg.ParticipantKeyB62 = string(ParticipantKey(roomName, identity))
|
msg.ParticipantKeyB62 = string(ParticipantKey(roomName, identity))
|
||||||
return r.writeRTCMessage(rtcSink, msg)
|
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 {
|
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)
|
return r.writeRTCMessage(rtcSink, msg)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user