ngrok icon indicating copy to clipboard operation
ngrok copied to clipboard

ngrok fails to start with console_ui set to true in ngrok configuration

Open shawsourav opened this issue 6 years ago • 5 comments

It fails silently without throwing an error. The error is because console_ui is not supported with stdout and stderr.

shawsourav avatar Aug 13 '19 09:08 shawsourav

Hi, is there any way to fix this problem?

I'm writing a library that uses this ngrok library. If users have console_ui: true in their $HOME/.ngrok2/ngrok.yml file, my library will fail to work.

To clarify, the console_ui option is mentioned in the doc: https://ngrok.com/docs

ngocdaothanh avatar Sep 03 '19 06:09 ngocdaothanh

Hi, great catch! You can fix it by ignoring or resetting the console_ui option here https://github.com/bubenshchykov/ngrok/blob/master/index.js#L22

Currently, stdout of ngrok process is used for communication with node.js, so any changes to ngrok stdout (like console_ui or logfmt options) will break the module.

bubenshchykov avatar Sep 15 '19 00:09 bubenshchykov

@bubenshchykov should I raise a PR with the change you mentioned so that devs don't get confused as to why it doesn't work when console_ui is true?

shawsourav avatar Nov 03 '19 05:11 shawsourav

@shawsourav thx, that would be great!

bubenshchykov avatar Nov 03 '19 09:11 bubenshchykov

@bubenshchykov The approach mentioned seems not feasible since --console_ui is not accepted key-value in the options now by ngrok binary itself 😢 Only way it could be reconfigured is by passing a config path but then in that it neglects the root config. Can we have something like this ngrok start -config ~/ngrok.yml -config ~/projects/example/ngrok.yml so that we can combine two configs?

shawsourav avatar Nov 09 '19 12:11 shawsourav