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

Node.js: ngrok.forward() issue #125

Closed
ballonura opened this issue Feb 29, 2024 · 4 comments
Closed

Node.js: ngrok.forward() issue #125

ballonura opened this issue Feb 29, 2024 · 4 comments

Comments

@ballonura
Copy link

ballonura commented Feb 29, 2024

try this command:

await ngrok.forward()

and get this issue:

[Error: failed to connect session: Usage of ngrok requires a verified account and authtoken.
Sign up for an account: https://dashboard.ngrok.com/signup
Install your authtoken: https://dashboard.ngrok.com/get-started/your-authtoken error_code: ERR_NGROK_4018] {
  code: 'GenericFailure',
  error

but when passing manuaaly it work:

{
  authtoken_from_env: false,
  authtoken: 'xxxxx-my-auth-token-my-auth-token-xxxxx'
}

Node.js version: v14.21.3
ngrok version: 3.6.0

@salilsub
Copy link
Contributor

Hi @ballonura , when running your initial command did you have the environment variable NGROK_AUTHTOKEN set ?

@ballonura
Copy link
Author

ballonura commented Feb 29, 2024

n0pe, how should i set it? i think the sdk itself know how get it.

@salilsub
Copy link
Contributor

In order to connect to the ngrok service, you need to supply a valid authtoken. There are two ways to do this with ngrok-javascript:

  1. Set authtoken_from_env to true (it defaults to false) and set the NGROK_AUTHTOKEN to your authtoken. How you set this environment variable will depend on your OS.
  2. Set authtoken_from_env to false and set authtoken to your authtoken as you did above when you passed manually.

@bobzilladev
Copy link
Contributor

Hello! Looks like this issue has been taken care of, so going to close this ticket out. Feel free to reopen if anything else comes up. Thanks again for writing in!

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

3 participants