-
-
Notifications
You must be signed in to change notification settings - Fork 33.8k
Closed
Labels
feature requestIssues that request new features to be added to Node.js.Issues that request new features to be added to Node.js.libuvIssues and PRs related to the libuv dependency or the uv binding.Issues and PRs related to the libuv dependency or the uv binding.osIssues and PRs related to the os subsystem.Issues and PRs related to the os subsystem.
Description
I think it would be very useful to have a method on os which returns
- the default gateway of the machine, v4 and v6
- the default gateway's network interface name (if any)
Basically, something like @indutny's netroute but cross-platform. The ability to access this information seems critical for applications that do low-level things on the local network and I think this justifies its existance in core. My personal use case would be to automatically determine the right interface to do packet capture on.
Right now, the only way (without native modules) to obtain the information in a cross-platform way would be parsing the output of various commands, which is of course slow and error-prone.
@bnoordhuis: the request has been brought up in 2012 and you rejected it as bloat. Does this still stand?
Metadata
Metadata
Assignees
Labels
feature requestIssues that request new features to be added to Node.js.Issues that request new features to be added to Node.js.libuvIssues and PRs related to the libuv dependency or the uv binding.Issues and PRs related to the libuv dependency or the uv binding.osIssues and PRs related to the os subsystem.Issues and PRs related to the os subsystem.