-
Notifications
You must be signed in to change notification settings - Fork 16
Add bindIp support for network servers #498
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
base: dev
Are you sure you want to change the base?
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
this.extServer = this.app.listen( | ||
this.ipInfo.externalPort, | ||
this.ipInfo.externalBindIp, | ||
() => { | ||
const msg = `External server running on port ${this.ipInfo.externalPort}...` | ||
console.log(msg) | ||
this.mainLogger.info('Network: ' + msg) | ||
} | ||
) |
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.
Suggestion: If this.ipInfo.externalBindIp
is undefined, passing it as the second argument to listen
may cause unexpected behavior or errors. Add logic to only include the bind IP if it is defined. [possible issue, importance: 8]
this.extServer = this.app.listen( | |
this.ipInfo.externalPort, | |
this.ipInfo.externalBindIp, | |
() => { | |
const msg = `External server running on port ${this.ipInfo.externalPort}...` | |
console.log(msg) | |
this.mainLogger.info('Network: ' + msg) | |
} | |
) | |
this.extServer = this.ipInfo.externalBindIp | |
? this.app.listen( | |
this.ipInfo.externalPort, | |
this.ipInfo.externalBindIp, | |
() => { | |
const msg = `External server running on port ${this.ipInfo.externalPort}...` | |
console.log(msg) | |
this.mainLogger.info('Network: ' + msg) | |
} | |
) | |
: this.app.listen( | |
this.ipInfo.externalPort, | |
() => { | |
const msg = `External server running on port ${this.ipInfo.externalPort}...` | |
console.log(msg) | |
this.mainLogger.info('Network: ' + msg) | |
} | |
) |
User description
Summary
externalBindIp
andinternalBindIp
to IP configurationTesting
npm test
PR Type
Enhancement, Documentation
Description
Added
externalBindIp
andinternalBindIp
to server IP configuration.Updated network server setup to use bind IPs.
Documented new bind IP fields in types and examples.
Enhanced configuration and reporting documentation for bind IPs.
Changes walkthrough 📝
server.ts
Add bind IP fields to server configuration defaults
src/config/server.ts
externalBindIp
andinternalBindIp
to default server IP config.index.ts
Use bind IPs for network server setup and config
src/network/index.ts
IPInfo
interface with bind IP fields and documentation.externalBindIp
if provided.internalBindIp
if provided.ipInfo
.shardus-types.ts
Add bind IP fields to server configuration types
src/shardus/shardus-types.ts
externalBindIp
andinternalBindIp
toServerConfiguration.ip
.lost-detection-planning.txt
Document bind IPs in node config example
docs/lost-detection-planning.txt
externalBindIp
andinternalBindIp
to node configuration example.reporting.md
Document bind IP fields in NodeIpInfo
docs/reporting.md
externalBindIp
andinternalBindIp
toNodeIpInfo
documentation.