Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[mirotalk] - add host protection functionality
- Loading branch information
1 parent
72a563c
commit 285c926
Showing
7 changed files
with
399 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
'use strict'; | ||
|
||
const Logs = require('./logs'); | ||
const log = new Logs('Host'); | ||
|
||
module.exports = class Host { | ||
constructor(ip, authorized) { | ||
this.auth = new Map(); | ||
this.auth.set(ip, authorized); | ||
//log.debug('AUTH ---> ', this.auth.get(ip)); | ||
} | ||
isAuthorized(ip) { | ||
return this.auth.has(ip); | ||
} | ||
deleteIP(ip) { | ||
return this.auth.delete(ip); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
285c926
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Host protection
Like in MiroTalk SFU
Just edit
.env
file to enable it (on default disabled)Update
22.11.2023Commit: ec14f5e#commitcomment-133251188
We introduced 2 new variables:
HOST_USER_AUTH
: When set totrue
, users are required to provide a valid username and password in the URL parameters to initialize or join a room.HOST_USERS
: This parameter represents the list ofvalid host users
..env file
Remove
the old variables:Add
the new variables:If
HOST_PROTECTED
is set totrue
, the logic remains the same as before.If
HOST_USER_AUTH
is set totrue
, user login is required.The Current Host protection logic if enabled