Using this extension inside a devcontainer
ijaouani opened this issue · 7 comments
Hello,
I am using VSCode with Remote Containers : https://code.visualstudio.com/docs/remote/containers.
It seems that this extension is not working in this condition: The download of ngrok works fine but the ngrok: set auth token command seems to do nothing. Config file ngrok.yml is not created.
The workaround I have found is to manually set it by using :
root ➜ ~/.../extensions/philnash.ngrok-for-vscode-1.9.2/dist/bin $ ./ngrok authtoken <mytoken>
Authtoken saved to configuration file: /root/.ngrok2/ngrok.yml
But this is really not the way I should do it.
Any idea ? Glad to help if you need logs or something.
Can you tell me what the underlying version of the ngrok executable is? If you start a tunnel it should show up in the status bar.
v2.3.40
Other things : I see in your codebase that I should see this message when using the auth token command:
return window.showInformationMessage(
'Your auth token has been saved to your ngrok settings.'
);
And nothing is displayed on my side.
Ok I have found an easy way for replication with official Microsoft devcontainer sample:
- Open VSCode and install Remote - Containers extension
- Use Remote-Containers: Try a Development Container Sample...
- Choose node
- Run the app (F5)
- The web server is available on port 3000 and you can access it locally
- Install ngrok-for-vscode extension
- ngrok set auth token with your private token
Here nothing happen no message - no config file created.
If you try to use ngrok start on 3000:
So you're able to start ngrok in the container using the extension, but you're not able to set the authtoken from the extension?
Exactly. Reproductible scenario described just before.
I just come by this issue, for me I think the issue is I've got LiveServer running in a devcontainer, but you can only reach it using http://127.0.0.1:[port]
on the host machine, which makes sense as localhost won't know about the devcontainer.
I think a potential fix for this is allowing a user to specify a non-local url, this is supported by ngrok