Giter Club home page Giter Club logo

ngrokextensions's Introduction

Ngrok Extensions for Visual Studio

Build status

Description

This extension allows you to use ngrok right from within Visual Studio. It will start a tunnel for each web application that is part of your solution.

Has been tested in Visual Studio 2015, 2017, 2019, and 2022.

Installation

From Visual Studio

Get it from the Visual Studio Gallery for VS 2022 or for VS 2019 and earlier. From within Visual Studio:

  1. Select Tools... Extensions and Updates...
  2. Click "Online" and select the "Visual Studio Gallery" along the left-hand side of the window.
  3. Type "ngrok" into the search box in the upper right.
  4. Click the "Download" button on the extension in the search results.

Build from Source

  1. Clone this repo
  2. Open with Visual Studio 2017 and build a Release build
  3. Find the .vsix file in the bin\Release folder
  4. Double-click the .vsix file to install

Usage

Currently, usage is super-simple. All you need to do is open a solution with one or more web projects and then choose "Start ngrok Tunnel" from the "Tools" menu.

Menu item

Custom ngrok Subdomains

If you have a paid ngrok account, you can make use of custom subdomains with this extension.

Specify the subdomain you would like it to use in a ngrok.subdomain key in the appSettings section of your web.config file like so:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <appSettings>
    <add key="ngrok.subdomain" value="my-cool-app"/>
    ... more appSettings keys omitted ...
  </appSettings>
  ... more config omitted ...
</configuration>

Custom ngrok Subdomains with ASP.NET Core or Azure Functions

If you are using an ASP.NET Core or Azure Functions project and want to test locally, you can set the ngrok.subdomain key in the appsettings.json file like so:

{
  "IsEncrypted": false,
  "Values": {
    "ngrok.subdomain": "my-cool-app",
    ... more app settings omitted ...
  }
}

You can also set this value in a secrets.json file as described here.

Feedback and Contribution

This is a brand new extension and would benefit greatly from your feedback and even your code contribution.

If you find a bug or would like to request a feature, open an issue.

To contribute, fork this repo to your own GitHub account. Then, create a branch on your own fork and perform the work. Push it up to your fork and then submit a Pull Request to this repo. This is called GitHub Flow.

Change Log

  • v0.9.14 - Add support for Visual Studio 2022.
  • v0.9.13 - Add support for https.
  • v0.9.12 - Add support for Visual Studio 2019.
  • v0.9.11 - Fix ngrok installer after ngrok download page changed.
  • v0.9.10 - Allow settings override in secrets.json. Thanks @ChristopherHaws!
  • v0.9.9 - Bug fixes. Find projects within Solution folders.
  • v0.9.8 - Bug fixes. Automatically install ngrok.exe if not found.
  • v0.9.7 - Support for ASP.NET Core projects. Thanks @ahanoff!
  • v0.9.6 - Added support for Visual Studio 2017.
  • v0.9.5 - Added support for Azure Function projects.
  • v0.9.4 - Added support for Node.js projects.
  • v0.9.3 - Fix crash when decimal values in ngrok's JSON response.
  • v0.9.2 - Allow customizing location of ngrok.exe.
  • v0.9.1 - Initial Release

Licensed under the MIT license. See the LICENSE file in the project root for more information.

Copyright (c) 2023 David Prothero

ngrokextensions's People

Contributors

ahanoff avatar craigomatic avatar dependabot[bot] avatar dprothero avatar swimburger avatar timheuer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ngrokextensions's Issues

ASP.NET Core project support in VS2017

Having some issues with Core support. At least when I choose it off the VS2017 menu, I think it's looking for a .NET project and not a Core project. Either way, it says it can't find any web sites. That would make sense because there's no web.config in my Core project.

Anyway. Cool product. I've moved on to ASP.NET Core and had problems with another project, so I'm hoping you'll get to it soon.

Specify web projects to ngrok

Hello,

It would be a good idea to specify the web projects that we would like to be integrated with ngrok as free users only are able to start up to 4 tunnels.

Thanks.

Not working in Local IIS

I started a web project with Local IIS, but when starting the ngrok tunnel I got

ngrok by @inconshreveable

Session Status                online
Session Expires               7 hours, 59 minutes
Version                       2.2.8
Region                        United States (us)
Web Interface                 http://127.0.0.1:4040
Forwarding                    http://bb59366e.ngrok.io -> localhost:42567
Forwarding                    https://bb59366e.ngrok.io -> localhost:42567

Connections                   ttl     opn     rt1     rt5     p50     p90
                              0       0       0.00    0.00    0.00    0.00

The forwarding is on port 42567 but my project is on port 80 because it's hosted in Local IIS, and I can't access it from the ngrok tunnel.
How can I solve?

Support appsettings.Development.json

This may be related to the following issue:
#30

But can you please support using the ngrok.subdomain value in the appsettings.Delopment.json rather than just the appsettings.json file, this will help keep the settings away form production.

Server unresponsive (502) when running against Ngrok

This is the oddest thing.

I was running this just fine against a test project and then one morning, it just quit working. It has to be something I've done, but I'm having trouble debugging it.

I launch the site in debug mode - the site comes up fine. I publish the site to Azure - the site comes up fine. But if I launch in debug mode and attempt to access it via an ngrok tunnel, my site just does nothing. The Inspect web page shows the call coming in and it looks find to me. Just nothing goes out.

I tried routing other sites using ngrok and they work fine.

I've tried using the VS2017 extension and the CLI launch - same each way.

I noticed when testing the other sites that I didn't have to grant permissions using netsh to handle those incoming requests and they still worked fine. I tried deleting the permissions for the site in question and it didn't help.

Ever hear of anything like this?

TIA

Azure Functions V2

Tools => Start ngrok Tunnel fails to find the Azure Functions V2 Project(because it does not have a filename that ends with funproj)

I am creating a branch and pushing it to it to test and will do a pull request soon

Solution:
include AzureFunctionsVersion in PortPropertyNames and continue like you would normaly. you can inspect the value for "V2" but it is not really needed and may limit functionality when V3 is released.

Access to the path disabled

When pop-up is answered yes if you want the tool to download and install the new version, an error message appears with "Access to the path 'C:\WINDOWS\System32\ngrok.exe' is denied. When answering no, nothing happens. Can't use the tool anymore like this

AppSettings vs 2017

I'm still getting the random domains even when I set the app settings... I must be setting them incorrectly but I am not sure how. I've tried the below:

  "Values": {
    "ngrok-subdomain": "myTunnel"
  },
  "ngrok-subdomain": "myTunnel",

Is there a way to start a named tunnel? (from ngrok config)

After install extension vs2017 - Did not find any web projects

Hi,

I'm new with ngrok, after install ngrok Extension, when i go to Tools>Start ngrok Tunner i get this error "Did not find web projects"

I have a solution , in this solution 3 projects added
1º A class library,
2º 4.5 framework asp.net web form project, (is set at startup project)
3º A console application

Any help is appreciated
Thanks in advance!

I'm receiving the following error

VSIX Installer:

This extension cannot be installed because the following references are missing:
Microsoft.VisualStudio.Component.CoreEditor

Open ngrok web interface

Idea: Open the ngrok web interface, possibly in a tab within Visual Studio. If this works, we could probably have the ngrok console window start minimized.

[Feature] Read settings from appsettings.Development.json and secrets.json

Hello,

It would be nice to not have to configure ngrok in the production appsettings.json file when it is only used for development. The easy change would be to also look in appsettings.Development.json for the value, however even this has some drawbacks. Since each developer will most likely have a different subdomain setup for their dev environment, it would be really nice if NgrokExtensions could look in the csproj file for the existence of a <UserSecretsId> property and then look for the config values from %APPDATA%\Microsoft\UserSecrets\{UserSecretsId}\secrets.json.

Thanks!

Chris

Install of extension incomplete (perhaps)

Following the installation of the ngrok plugin for VS2017 the appropriate menu option appears. However, when I select that menu option (Tools ->Start ngrok Tunnel) I receive a message stating that it is not installed...and offering to do so.

notinstalled

If I select Yes, I am then given a null reference exception:
nullreference

Installing plugins is pretty simple, I can't imagine what I might have done 'wrong'

(also reported: https://stackoverflow.com/q/48334215/681009)

Add support for https localhost

Ngrok recently addedd support for https localhost. (See this issue)
Maybe this extension should add support too? Ngrok already starts on the SSL URL if its available, but it should be 'https' before localhost instead of 'http'.

.NET Core projects are also https by default, so it should apply there too.

ngrok 2.3.34 or above is not installed

When I click "start ngrok tunnel" from Visual studio 2019 (version 16.5.5), displaying a message "ngrok 2.3.34 or above is not installed. Would you like me to download it from ngrok.com and install it for you. If I press Yes, got an error message: "Access to the path 'C:\windows\System32\ngrok.exe' is denied."

Would be nice to have a tool window that allows one to graphically edit the `app.config`, `web.config` etc files in a user-friendly manner

This is just a "nice-to-have." More of a feature suggestion really.

However, instead of having to remember cryptic .config file commands and to reduce the chance for errors (I just hate it, personally, when software does not work as I expect simply because I typed one character wrong in some config file).

The suggestion is to make the extension add some sort of graphical tool window, or maybe an extra tab onto Project -> Properties in order to alter the config in a user-friendly manner.

Install ngrok not working

I am using Visual Studio 2017.

When I try to open a tunnel, I get a message saying that ngrok is not installed and offering to install it. When I click "yes", the installation fails with an "Object reference not set to an instance of an object" error.

I have already downloaded, but don't know where to put it, for the extension to find it. How can I install ngrok manually until this issue has been fixed?

Gray out (disable) the Start ngrok Tunnel menu item depending on VS state

Also, the menu item should really be initial-capitalized, instead of tunnel as the last word of the command, with a lowercase t, it should be uppercase T.

In any event, add an update handler to the command where the Start ngrok Tunnel menu item is disabled if any of the following are true:

(a) Visual Studio is open but no solution is currently loaded
(b) A solution is loaded and there are no Web projects in it

Ideally, there should also be settings via Tools -> Options that allows the user to override this behavior (say, if they are building a console or Windows Sockets app such as for Cybersecurity applications).

> Ngrok recently addedd support for https localhost. (See [this issue](https://github.com/inconshreveable/ngrok/issues/448#issuecomment-468329794))

Ngrok recently addedd support for https localhost. (See this issue)
Maybe this extension should add support too? Ngrok already starts on the SSL URL if its available, but it should be 'https' before localhost instead of 'http'.

.NET Core projects are also https by default, so it should apply there too.

;)-false

Originally posted by @brandonn12 in #29 (comment)

Unable to select the projects to start the tunnel.

By default, it is getting started for multiple project. Is there a way i can specify the ports for which the tunnels should be enabled. Looks like there is no option to control the port numbers we want the tunnel to be active.
image

Display QR code with ngrok tunnel URL

Display a QR code generated with ngrok tunnel URL when started (at least the option to do so).

Use case:
I've been using the free tier with the randomized ngrok.io subdomain to test localhost on mobile devices outside network. I would love to not have to type in the new URL manually every time. I currently accomplish this flow using a QR generator extension in Chrome then scan with phone to open URL. It'd be nice to have it just display when started like the web interface - perhaps in a tab within VS.

A mashup with some of this extensions functionality - VSCode QR Code

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.