Skip to content

Commit

Permalink
Revert "server: make fetching network interfaces optional (koush#1474)"
Browse files Browse the repository at this point in the history
This reverts commit 0160502.
  • Loading branch information
bjia56 committed May 17, 2024
1 parent 0ae93a9 commit 374036b
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions server/src/server-settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,7 @@ function nodeIpAddress(family: number): string[] {
...costlyNetworks,
];

let interfaces: any;
try {
interfaces = os.networkInterfaces();
} catch {
// bjia56: When running in secured environments like UserLAnd in Android, os.networkInterfaces()
// is unable to get addresses and throws an error. Therefore, assume we can't find any addresses.
return [];
}
const interfaces = os.networkInterfaces();

const all = Object.keys(interfaces)
.map((nic) => {
Expand Down

0 comments on commit 374036b

Please sign in to comment.