livekit wip
This commit is contained in:
63
examples/meet/server/README.md
Normal file
63
examples/meet/server/README.md
Normal file
@@ -0,0 +1,63 @@
|
||||
# LiveKit Meet Server
|
||||
|
||||
A simple backend server to provide connection details for the LiveKit Meet demo app.
|
||||
|
||||
## Features
|
||||
|
||||
- `/api/connection-details` endpoint for room connection details
|
||||
- CORS support for frontend requests
|
||||
- Static file serving for the built WASM app
|
||||
- Health check endpoint
|
||||
|
||||
## Usage
|
||||
|
||||
1. Build the frontend first:
|
||||
```bash
|
||||
cd .. && trunk build
|
||||
```
|
||||
|
||||
2. Run the server:
|
||||
```bash
|
||||
cd server && cargo run
|
||||
```
|
||||
|
||||
3. Access the app at: http://localhost:8083
|
||||
|
||||
## API Endpoints
|
||||
|
||||
- `GET /api/connection-details?roomName=<room>&participantName=<name>` - Get connection details
|
||||
- `GET /health` - Health check
|
||||
|
||||
## Production Setup
|
||||
|
||||
For production use, you'll need to:
|
||||
|
||||
1. Replace the mock token generation with proper LiveKit JWT tokens
|
||||
2. Add your actual LiveKit server URL
|
||||
3. Add proper authentication and validation
|
||||
4. Use environment variables for configuration
|
||||
|
||||
Example with real LiveKit tokens:
|
||||
|
||||
```rust
|
||||
use livekit_api::access_token::{AccessToken, VideoGrant};
|
||||
|
||||
fn generate_token(room_name: &str, participant_name: &str) -> String {
|
||||
let api_key = std::env::var("LIVEKIT_API_KEY").unwrap();
|
||||
let api_secret = std::env::var("LIVEKIT_API_SECRET").unwrap();
|
||||
|
||||
let grant = VideoGrant {
|
||||
room_join: true,
|
||||
room: room_name.to_string(),
|
||||
..Default::default()
|
||||
};
|
||||
|
||||
let token = AccessToken::new(&api_key, &api_secret)
|
||||
.with_identity(participant_name)
|
||||
.with_video_grant(grant)
|
||||
.to_jwt()
|
||||
.unwrap();
|
||||
|
||||
token
|
||||
}
|
||||
```
|
Reference in New Issue
Block a user