Skip to content

Commit

Permalink
config: add webrtc parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
iameli committed Jan 19, 2024
1 parent 2dbf999 commit 9d45648
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
19 changes: 19 additions & 0 deletions cmd/catalyst/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,25 @@ func GenerateConfig(cli *Cli) ([]byte, []byte, error) {
protocol.LivepeerAccessToken = cli.Secret
} else if protocol.Connector == "livepeer" && protocol.Broadcaster && protocol.MetadataQueueURI != "" {
protocol.AuthWebhookURL = fmt.Sprintf("http://%s:%[email protected]:3004/api/stream/hook", adminID, cli.Secret)
} else if protocol.Connector == "WebRTC" {
protocol.ICEServers = []ICEServer{
{
URLs: fmt.Sprintf("stun:%s:3478", u.Hostname()),
},
{
Credential: "livepeer",
URLs: fmt.Sprintf("turn:%s:3478", u.Hostname()),
Username: "livepeer",
},
{
URLs: fmt.Sprintf("stun:%s:5349", u.Hostname()),
},
{
Credential: "livepeer",
URLs: fmt.Sprintf("turn:%s:5349", u.Hostname()),
Username: "livepeer",
},
}
}
}

Expand Down
12 changes: 10 additions & 2 deletions cmd/catalyst/config/full-stack.spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -185,11 +185,19 @@
"bindhost": "127.0.0.1",
"iceservers": [
{
"urls": "stun:localhost"
"urls": "stun:example.com:3478"
},
{
"credential": "livepeer",
"urls": "turn:localhost",
"urls": "turn:example.com:3478",
"username": "livepeer"
},
{
"urls": "stun:example.com:5349"
},
{
"credential": "livepeer",
"urls": "turn:example.com:5349",
"username": "livepeer"
}
],
Expand Down

0 comments on commit 9d45648

Please sign in to comment.