src/bastion.js
function getPublicIp() {
  return new Promise((resolve, reject) => {
    const options = {
      host: 'api.ipify.org',
      port: 80,
      path: '/',
    };
    http
      .get(options, res => {
        res.setEncoding('utf8');

        let body = '';
        res.on('data', chunk => {
          body += chunk;
        });

        res.on('end', () => {
          resolve(body);
        });
      })
      .on('error', err => {
        reject(err);
      });
  });
}
function getPublicIp() {
  return new Promise((resolve, reject) => {
    const options = {
      host: 'api.ipify.org',
      port: 80,
      path: '/',
    };
    http
      .get(options, res => {
        res.setEncoding('utf8');

        let body = '';
        res.on('data', chunk => {
          body += chunk;
        });

        res.on('end', () => {
          resolve(body);
        });
      })
      .on('error', err => {
        reject(err);
      });
  });
}
function getPublicIp ( ) { return new Promise ( ( resolve , reject ) => { const options = { host : 'api.ipify.org' , port : 80 , path : '/' , } ; http . get ( options , res => { res . setEncoding ( 'utf8' ) ; let body = '' ; res . on ( 'data' , chunk => { body += chunk ; } ) ; res . on ( 'end' , ( ) => { resolve ( body ) ; } ) ; } ) . on ( 'error' , err => { reject ( err ) ; } ) ; } ) ; }
Return the public IP

@return {Promise}
Return the public IP