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

Takes a minute to start #159

Open
slavafomin opened this issue Nov 10, 2024 · 1 comment
Open

Takes a minute to start #159

slavafomin opened this issue Nov 10, 2024 · 1 comment

Comments

@slavafomin
Copy link

slavafomin commented Nov 10, 2024

SDK Version

1.4.1

What happened?

The library takes a lot of time to start.

Consider the following script:

import ngrok from '@ngrok/ngrok';

ngrok.consoleLog('TRACE');

try {

  const listener = await ngrok.forward({
    addr: '8080',
    authtoken: '…',
  });

  console.log(listener.url());

} catch (error) {

  console.error(error);

}

I'm getting the following log output:

DEBUG log - add_parsable_certificates processed 1 valid and 0 invalid certs

(HANGS HERE FOR A LONG TIME)

DEBUG log - No cached session for DnsName("connect.ngrok-agent.com")
DEBUG log - Not resuming any session
DEBUG log - Using ciphersuite TLS13_AES_128_GCM_SHA256
DEBUG log - Not resuming
DEBUG log - TLS1.3 encrypted extensions: []
DEBUG log - ALPN protocol is None
DEBUG muxado::heartbeat - sending heartbeat
DEBUG muxado::heartbeat - waiting for response
DEBUG muxado::heartbeat - got response
DEBUG ngrok::internals::raw_session - decoded rpc response
INFO ngrok_javascript::session - Session created "", with auth token
DEBUG muxado::typed - read stream type
DEBUG muxado::stream_manager - got none from stream, trying to send a fin
DEBUG muxado::stream_manager - removing stream and sending fin
DEBUG ngrok::internals::raw_session - decoded rpc response
INFO ngrok_javascript::listener - Created listener "" with url "https://xxx.ngrok-free.app"
DEBUG muxado::stream_manager - got none from stream, trying to send a fin
DEBUG muxado::stream_manager - removing stream and sending fin
https://xxx.ngrok-free.app
Error logging to javascript function: Error { status: GenericFailure, reason: "Closing", maybe_raw: 0x0 }

I'm running it under Linux. The ngrok binary (installed from apt) works fine if I use it directly.

What could be the reason for this? Thank you.

@slavafomin
Copy link
Author

slavafomin commented Nov 10, 2024

Okay, the fact that it's closing is caused by the script stopping execution. Don't know why the library is not keeping the process running, but this is yet another story.

I'm more concerned with the fact that it takes a whole minute to start. The ngrok binary starts in a second. Would really appreciate some tips.

@slavafomin slavafomin changed the title Hangs for a long time, then fails Takes a minute to start Nov 10, 2024
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

1 participant