File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import asyncio
22import logging
3+ import os
34from signal import SIGINT , SIGTERM
45
56import numpy as np
67from livekit import rtc
78
8- URL = "ws://localhost:7880"
9- TOKEN = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE5MDY2MTMyODgsImlzcyI6IkFQSVRzRWZpZFpqclFvWSIsIm5hbWUiOiJuYXRpdmUiLCJuYmYiOjE2NzI2MTMyODgsInN1YiI6Im5hdGl2ZSIsInZpZGVvIjp7InJvb20iOiJ0ZXN0Iiwicm9vbUFkbWluIjp0cnVlLCJyb29tQ3JlYXRlIjp0cnVlLCJyb29tSm9pbiI6dHJ1ZSwicm9vbUxpc3QiOnRydWV9fQ.uSNIangMRu8jZD5mnRYoCHjcsQWCrJXgHCs0aNIgBFY" # noqa
9+ URL = os .environ .get ("LIVEKIT_URL" , "ws://localhost:7880" )
10+ TOKEN = os .environ .get (
11+ "LIVEKIT_TOKEN" ,
12+ "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE5MDY2MTMyODgsImlzcyI6IkFQSVRzRWZpZFpqclFvWSIsIm5hbWUiOiJuYXRpdmUiLCJuYmYiOjE2NzI2MTMyODgsInN1YiI6Im5hdGl2ZSIsInZpZGVvIjp7InJvb20iOiJ0ZXN0Iiwicm9vbUFkbWluIjp0cnVlLCJyb29tQ3JlYXRlIjp0cnVlLCJyb29tSm9pbiI6dHJ1ZSwicm9vbUxpc3QiOnRydWV9fQ.uSNIangMRu8jZD5mnRYoCHjcsQWCrJXgHCs0aNIgBFY" ,
13+ ) # noqa
1014
11- # ("livekitrocks") this is our shared key, it must match the one used by your clients
12- SHARED_KEY = b" livekitrocks"
15+ # This shared key must match the one used by your clients
16+ SHARED_KEY = os . environ . get ( "E2EE_SHARED_KEY" , " livekitrocks"). encode ()
1317
1418WIDTH , HEIGHT = 1280 , 720
1519
@@ -106,7 +110,7 @@ def on_e2ee_state_changed(participant: rtc.Participant, state: rtc.EncryptionSta
106110 e2ee_options .key_provider_options .shared_key = SHARED_KEY
107111
108112 await room .connect (
109- URL , TOKEN , options = rtc .RoomOptions (auto_subscribe = True , e2ee = e2ee_options )
113+ URL , TOKEN , options = rtc .RoomOptions (auto_subscribe = True , encryption = e2ee_options )
110114 )
111115
112116 logging .info ("connected to room %s" , room .name )
You can’t perform that action at this time.
0 commit comments