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

Using this extension inside a devcontainer #34

Open
ijaouani opened this issue Apr 7, 2022 · 7 comments
Open

Using this extension inside a devcontainer #34

ijaouani opened this issue Apr 7, 2022 · 7 comments

Comments

@ijaouani
Copy link

ijaouani commented Apr 7, 2022

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.

image

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.

@philnash
Copy link
Owner

philnash commented Apr 7, 2022

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.

@ijaouani
Copy link
Author

ijaouani commented Apr 7, 2022

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.

@ijaouani
Copy link
Author

ijaouani commented Apr 7, 2022

Ok I have found an easy way for replication with official Microsoft devcontainer sample:

  1. Open VSCode and install Remote - Containers extension
  2. Use Remote-Containers: Try a Development Container Sample...
  3. Choose node
  4. Run the app (F5)
  5. The web server is available on port 3000 and you can access it locally
  6. Install ngrok-for-vscode extension
  7. 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:

image

@ijaouani
Copy link
Author

ijaouani commented Apr 7, 2022

The error from vscode developer tools:

image

The root cause is the path which is not correct (dist is missing):

image

@philnash
Copy link
Owner

philnash commented Apr 7, 2022

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?

@ijaouani
Copy link
Author

ijaouani commented Apr 8, 2022

Exactly. Reproductible scenario described just before.

@cmjchrisjones
Copy link

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

https://ngrok.com/docs/secure-tunnels/non-local

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