Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow Listening to Specific Hosts #48

Merged
merged 4 commits into from
Apr 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion config/custom-environment-variables.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@ redisHost: REDIS_HOST
redisPort: REDIS_PORT
redisPassword: REDIS_PASSWORD

clientHost: CLIENT_HOST

mcs-port: MCS_PORT
mcs-address: MCS_HOST
mcs-host: MCS_HOST
mcs-address: MCS_ADDRESS

freeswitch:
ip: FREESWITCH_CONN_IP
Expand Down
2 changes: 2 additions & 0 deletions config/default.example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ redisPort: "6379"
# Uncomment to set a password if Redis requires auth.
# redisPassword: foobared
clientPort: "3008"
clientHost: 127.0.0.1
minVideoPort: 30000
maxVideoPort: 33000
mediaFlowTimeoutDuration: 15000
Expand Down Expand Up @@ -59,6 +60,7 @@ redisExpireTime: 1209600 # 14 days as per the akka keys
# mcs-core entrypoint configured on nginx
mcs-path: /mcs
mcs-port: 3010
mcs-host: 127.0.0.1
mcs-address: localhost
mcs-ws-timeout: 30000
freeswitch:
Expand Down
3 changes: 2 additions & 1 deletion lib/connection-manager/HttpServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ module.exports = class HttpServer {
//const credentials = {key: privateKey, cert: certificate};

this.port = config.get('clientPort');
this.host = config.has('clientHost') ? config.get('clientHost') : '127.0.0.1';

this.server = http.createServer((req,res) => {
}).on('error', this.handleError.bind(this))
Expand All @@ -36,7 +37,7 @@ module.exports = class HttpServer {

listen(callback) {
Logger.info('[HttpServer] Listening in port ' + this.port);
this.server.listen(this.port, callback);
this.server.listen(this.port, this.host, callback);
}

}
3 changes: 2 additions & 1 deletion lib/mcs-core/process.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ class CoreProcess extends BaseProcess {
startMCSServer () {
// HTTPS server
const port = config.get('mcs-port');
const host = config.has('mcs-host') ? config.get('mcs-host') : '127.0.0.1';
const connectionTimeout = config.get('mcs-ws-timeout');
const serverHttps = http.createServer().listen(port, () => {
const serverHttps = http.createServer().listen(port, host, () => {
Logger.info('[app] MCS Server is ready to receive connections');
});

Expand Down