Skip to content
This repository has been archived by the owner on Aug 28, 2021. It is now read-only.

Commit

Permalink
feature(server) allow server to bind to specific ip's
Browse files Browse the repository at this point in the history
  • Loading branch information
arendvw committed Mar 24, 2019
1 parent f12a1d9 commit 0762ab4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .env-base
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ PLUGIN_DIRS="./node_modules/@speckle,./plugins"
# if you have any firewalls set up (ie, ufw).
PORT=3000

# IP: The ip to listen to
# Defaults to all IPs bound to this machine, and all IPv6 IPs if IPv6 is enabled.
#IP=127.0.0.1

# MAX_PROC: The maximum amount of service workers to start. If this is not specified,
# Speckle will fork out as many as the machine's processor cores. To specify it,
# just uncomment the line below.
Expand Down
3 changes: 2 additions & 1 deletion server.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@ if ( cluster.isMaster ) {
/// /////////////////////////////////////////////////////////////////////

var port = process.env.PORT || 3000
server.listen( port, ( ) => {
var ip = process.env.IP || null
server.listen( port, ip, ( ) => {
logger.debug( chalk.yellow( `Speckle worker process ${process.pid} now running on port ${port}.` ) )
} )
}

0 comments on commit 0762ab4

Please sign in to comment.