[Feature] Connect to a Coturn server using REST API

This allows connecting to a TURN server with temporary passwords.
The passwords are expiring after 4 hours.
This commit is contained in:
David Négrier
2021-02-16 09:58:08 +01:00
parent e07efbdf28
commit cdb3cfdc81
11 changed files with 67 additions and 16 deletions
+3 -3
View File
@@ -17,7 +17,7 @@ export class ScreenSharingPeer extends Peer {
public toClose: boolean = false;
public _connected: boolean = false;
constructor(private userId: number, initiator: boolean, private connection: RoomConnection) {
constructor(private userId: number, initiator: boolean, private connection: RoomConnection, webRtcUser: string | undefined, webRtcPassword: string | undefined) {
super({
initiator: initiator ? initiator : false,
reconnectTimer: 10000,
@@ -28,8 +28,8 @@ export class ScreenSharingPeer extends Peer {
},
{
urls: TURN_SERVER.split(','),
username: TURN_USER,
credential: TURN_PASSWORD
username: webRtcUser || TURN_USER,
credential: webRtcPassword || TURN_PASSWORD
},
]
}