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

Google Cloud External IP #92

Open
nitingautam opened this issue Jun 26, 2018 · 1 comment
Open

Google Cloud External IP #92

nitingautam opened this issue Jun 26, 2018 · 1 comment

Comments

@nitingautam
Copy link

How to know External IP of a Google compute engine where my NodeJs application running. all time it shows internal Ip

@HMarzban
Copy link

It is so easy, first get all interface exist in your Google compute engine, then follow code below:

const os = require('os');
const ip = require('ip');

// it gives you array of interfaces,
// you can pick the name of that interface you wanna get IP address
os.networkInterfaces(); 

ip.address("_interfaceName","ipv4") // you can now obtain the interface IP address you wanted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants