Removed cli, mux cleanup, docs update

This commit is contained in:
David Zhao
2021-05-07 01:16:33 -07:00
parent 933bdb9a2f
commit d399a57a7b
21 changed files with 963 additions and 738 deletions
+76 -58
View File
@@ -1,103 +1,121 @@
# LiveKit - Open source, distributed video/audio rooms based on WebRTC
# LiveKit - Open source, distributed video/audio rooms over WebRTC
## Building
LiveKit is an open source project that provides scalable, multi-user conferencing over WebRTC. It's designed to give you everything you need to build real time video/audio capabilities in your applications.
## Features
- Horizontally scalable WebRTC Selective Forwarding Unit (SFU)
- Modern, full-featured [client SDKs](references/client-sdks.md) for JS, iOS, Android
- Built for production - JWT authentication and [server APIs](references/server-apis.md)
- Robust networking & connectivity, over UDP & TCP
- Easy to deploy, a single binary and only three ports to forward.
- Advanced features - simulcasting, selective subscription, moderation APIs.
## Documentation & Guides
Docs & Guides at: https://docs.livekit.io
## SDKs & APIs
Client SDKs:
- [Javascript](https://github.com/livekit/client-sdk-js) ([docs](https://docs.livekit.io/client-sdk-js/))
- [iOS - Swift](https://github.com/livekit/client-sdk-ios) ([docs](https://docs.livekit.io/client-sdk-ios/))
- [Android - Kotlin](https://github.com/livekit/client-sdk-android) ([docs](https://docs.livekit.io/client-sdk-android/))
Server APIs:
- [Javascript](https://github.com/livekit/server-api-js) ([docs](https://docs.livekit.io/server-api-js/))
- [Go](https://github.com/livekit/livekit-sdk-go) ([docs](https://pkg.go.dev/github.com/livekit/livekit-sdk-go))
## Installing
### From source
Ensure Go 1.15+ is installed, and GOPATH/bin is in your PATH.
Run `./bootstrap.sh` to install mage, then `mage` to build the project
```shell
git clone https://github.com/livekit/livekit-server
cd livekit-server
./bootstrap.sh
mage
```
## Creating API keys
### Docker
LiveKit is published to dockerhub under livekit/livekit-server
## Running
### Creating API keys
LiveKit utilizes JWT based access tokens for authentication to all of its APIs.
Because of this, the server needs a list of valid API keys and secrets to validate the provided tokens. For more, see [Authentication](docs/authentication.md).
Generate API key/secret pairs with:
```
```shell
./bin/livekit-server generate-keys
```
or
```shell
docker run livekit/livekit-server:v0.9 generate-keys
```
Store the generate keys in a YAML file like:
```yaml
APIwLeah7g4fuLYDYAJeaKsSE: 8nTlwISkb-63DPP7OH4e.nw.J44JjicvZDiz8J59EoQ+
```
## Running the server
LiveKit server is a distributed service that is architected for scale. It's self-encapsulated in a single binary, and horizontally scalable by adding more instances. In a production setup, the only external dependency is Redis. LiveKit uses Redis to store room & participant information, and utilizes its pub/sub functionality to coordinate activity between instances.
### Running for development
### Starting the server
In development mode, LiveKit has no external dependencies. With the key file ready, you can start LiveKit with
```
```shell
./bin/livekit-server --key-file <path/to/keyfile> --dev
```
or
```shell
docker run -e LIVEKIT_KEYS="<key>: <secret>" livekit/livekit-server:v0.9 --dev
```
the `--dev` flag turns on log verbosity to make it easier for local debugging/development
### Running for production
### Sample client
TBD
[client-sdk-js](https://github.com/livekit/client-sdk-js) contains a web sample client that can connect to your server locally.
## CLI
Clone the repo and run `yarn sample`
The CLI provides a few tools that makes working with LiveKit easier:
### Creating a JWT token
- Room creation/deletion/etc
- Access token creation
- Joining room as a participant
- Publishing files as tracks to a room
To create a join token for clients, livekit-server provides a convenient subcommand to create a **development** token.
This token has an expiration of a month, which is useful for development & testing, but not appropriate for production use.
### Setting API key and secret
CLI commands require --api-key and --api-secret arguments. To avoid having to pass these in for each command, it's simplest to set them as environment vars:
```bash
export LK_API_KEY=<key>
export LK_API_SECRET=<secret>
```shell
./bin/livekit-server --key-file <path/to/keyfile> create-join-token --room "myroom" --identity "myidentity"
```
### Creating a room (optional)
```
./bin/livekit-cli create-room --name myroom
```
## Deploying for production
### Creating a participant token
LiveKit is deployable to any environment that supports docker, including Kubernetes and Amazon ECS
```
./bin/livekit-cli create-token --join --r myroom --dev --p <participant name>
```
See documentation at https://docs.livekit.io/guides/deploy
`--dev` creates a development token that doesn't expire for a year
## License
### Joining a participant
```
./bin/livekit-cli join --token <token>
```
### Publishing static files as tracks
To use the publish client, download the following files to your computer:
- [happier.ivf](https://www.dropbox.com/s/4ze93d6070s0qj7/happier.ivf?dl=0) - video track in VP8
- [happier.ogg](https://www.dropbox.com/s/istrnolnh7avftq/happier.ogg?dl=0) - audio track in ogg
Join as a publishing participant
```
./ bin/livekit-cli join --audio <path/to/ogg> --video <path/to/ivf> --token <token>
```
That's it, join the room with another participant and see it receiving those tracks
LiveKit server is licensed under AGPL v3.0.
## APIs & Protocol
`livekit-server` provides two primary services, a `Room` service that allows for room creation & management, and `RTC` service to handle real time communications.
`livekit-server` provides two primary services, a `Room` service that allows for room management and participant moderation, and `RTC` service to handle WebRTC communications.
Room APIs are defined in [room.proto](proto/room.proto), it's fairly straight forward with typical CRUD APIs. Room APIs are in HTTP, built with Twirp and follows [its the conventions](https://twitchtv.github.io/twirp/docs/routing.html).
Room APIs are defined in [room.proto](proto/room.proto). Room APIs are in HTTP, built with Twirp and follows [its the conventions](https://twitchtv.github.io/twirp/docs/routing.html).
The RTC service provides the signaling and everything else when the client interacts with the room. See [RTC Protocol](docs/protocol.md).
The RTC service provides the signaling and everything else when the client interacts with the room.