How to use the ngrok.kill function in ngrok

To help you get started, we’ve selected a few ngrok examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github adobe / wskdebug / src / debugger.js View on Github external
if (this.liveReloadServer.server) {
                    this.liveReloadServer.close();
                } else {
                    this.liveReloadServer.watcher.close();
                }
                this.liveReloadServer = null;
            });
        }

        if (this.ngrokServer) {
            await this.tryCatch(() => {
                this.ngrokServer.close();
                this.ngrokServer = null;
            });
        }
        await this.tryCatch(ngrok.kill());

        // only log this if we started properly
        if (this.ready) {
            console.log(`Done`);
        }
        this.ready = false;
    }
github RickWong / local-webhook / LocalWebhook.js View on Github external
LocalWebhook.expressServer = app.listen(expressPort, function() {
        debug("express started on http://localhost:" + expressPort);
      });

      LocalWebhook.service = serverOptions.service;
      switch (LocalWebhook.service) {
        case "ngrok":
          // Start ngrok.
          var ngrok = require("ngrok");
          var ngrokPort = expressPort;
          var ngrokRegion = serverOptions.region || "us";
          var ngrokSubdomain = serverOptions.subdomain || undefined;
          var ngrokAuthToken = serverOptions.authtoken || undefined;

          ngrok.kill().then(function() {
            ngrok
              .connect({
                addr: ngrokPort,
                region: ngrokRegion,
                subdomain: ngrokSubdomain,
                authtoken: ngrokAuthToken,
                bind_tls: true,
              })
              .then(function(ngrokUrl) {
                LocalWebhook.publicUrl = ngrokUrl;
                debug("ngrok started on " + LocalWebhook.publicUrl);
                resolve();
              }, reject);
          });
          break;
github poppinss / indicative / bin / qunit.js View on Github external
console.log('annotating jobs result')
    for (let result of results) {
      await sauceLabs.annotateJob(result.job_id, buildId, result.result.failed === 0)
    }
    console.log(chalk`{green done}`)
  } catch (error) {
    console.log(chalk`  {red Reaceived error}`)
    console.log(error)
    exitCode = 1
  }

  /**
   * Cleanup
   */
  ngrok.kill()
  server.close()
  process.exit(exitCode)
}
github expo / xdl / src / PackagerController.js View on Github external
static exit() {
    let pc = global._PackagerController;
    if (pc) {
      if (pc._expressServer) {
        pc._expressServer.close();
      }
      if (pc._packager) {
        pc._packager.kill('SIGTERM');
      }
      if (pc._ngrokUrl || pc._packagerNgrokUrl) {
        ngrok.kill();
      }
    }
  }
github philipwalton / easy-sauce / lib / services / ngrok.js View on Github external
stop() {
    if (this.isStarted()) ngrok.kill();
  }
}
github cvalenzuela / carbon / app / components / Toolbar.js View on Github external
this.props.setURL(url);
        log.info(url);
        this.props.setWorldPublic(true);
        this.setState({
          msg: 'You are now sharing with the world!',
          lastClient: '',
          logs: {
            top: '2.3em',
            borderBottom: '2px solid #186926'
          }
        });
      });
    } else if (this.props.serverStatus === 'RUNNING' && this.props.worldPublic) {
      this.props.setURL(`http://${this.props.ip}:${this.props.port}`);
      ngrok.disconnect();
      ngrok.kill();
      this.props.setWorldPublic(false);
      this.setState({
        msg: 'Just sharing locally!',
        lastClient: '',
        logs: {
          top: '2.3em',
          borderBottom: '2px solid #186926'
        }
      });
    } else {
      this.setState({
        msg: 'Click Start and then share with the world',
        lastClient: '',
        logs: {
          top: '2.3em',
          borderBottom: '2px solid #691850'

ngrok

node wrapper for ngrok

BSD-2-Clause
Latest version published 12 months ago

Package Health Score

82 / 100
Full package analysis