ngrok forwarding link has wrong format - ngrok

I used ngrok and got a normal(working) link, but the next day got (not once) a different link format. What does that link mean?
Web Interface http://127.0.0.1:4040
Forwarding https://1a38-2600-1700-880-be80-78c9-a061-2103-62a

Related

ngrok having issues starting - X509 certificate signed by unknown authority

I'm using ngrok 3.1.1 and trying to open up port 8000 so I can do some local testing. However, I keep running into some issues.
First off, I've downloaded and installed ngrok from the official site, and then added by authorisation token using:
ngrok config add-authtoken blahblahblahcrazywordsmoustache
So far so good. Then, trying to open ngrok using:
ngrok http 8000
Yields the following errors:
reconnecting (x509: certificate signed by unknown authority)
Followed by:
reconnecting (jsonHTTP.Lookup: No such host: tunnel.ngrok.com)
And...
reconnecting (resolved tunnel.ngrok.com has no records)
The ngrok.yml looks like this:
root_cas: trusted
version: "2"
authtoken: ohlooksomelettersarenttheynice
Any idea what I can do? This is on a corporate network, with various firewalls etc. I'm told that ngrok will create a url that I can use in my code tests, but we can't whitelist that url until we know what it is, and we don't know what it is until ngrok starts and generates it.
Okay, not quite a solution but more of a work-around.
Disconnected my computer from the corporate network, used a wifi dongle and hotspotted to my phone.
Got an error saying that my account wasn't authorised to use custom CAs. Wracked my head for a bit until I remembered that I had seen cas before, in the yml file. Removed the
root_cas: trusted
from the yml, and all working fine and dandy.

ngrok with visual studio 2017 and IIS express fails to connect

So I'm trying to setup my dev machine to be able to respond to some webhooks, as per the twilio documentation here:
https://www.twilio.com/docs/usage/tutorials/how-use-ngrok-windows-and-visual-studio-test-webhooks
I've got ngrok installed, and have the tunnel up and running, pointing at the port that is specified in visual studio. In this case, 44336.
However, if I go to visit the external URL, I get a very long load time, and eventually a 502 error. Visiting localhost works fine as expected.
So, I tried setting ngrok to point at 8080, and I get a little further along, but still no luck with the following error message in the browser.
With the first tunnel attempt, I can see the GET/ requests show up in the ngrok client, but no error. In the second attempt, I can see the 502 errors:
So I have two questions: How can I diagnose the source of the problem? And how can I setup IIS to accept connections from ngrok?
This is resolved in the latest version of ngrok (at this time 2.3.23).
A related closed issue can be referenced here: https://github.com/inconshreveable/ngrok/issues/448
You can now run:
ngrok http https://localhost:<port> -host-header="localhost:<port>"
for your example:
ngrok http https://localhost:44336 -host-header="localhost:44336"
Just go Right click on project -> Properties, and then disable ssl.

How to respond to HTTP POST from unix (AIX, RHEL, or UB) server?

I am building a custom slash command for slack. When the slack user types a command, ex /uptime, a HTTP POST message is sent to the server URL.
The tutorials I've read all include installing a tool such as ngrok, pagekite, or localtunnel to generate a URL for the local machine.
Since I am working with a server, can I not just open a port and have slack connect directly to that hostname and port? How can I do this?
Doing some research, I came across opening a port with nc, then listening with curl, however I don't understand how to put it all together.
Yes, if you are running your script for handling the POST requests from Slack on a server that has a URL that can be reached on the Internet you do not need a local tunnel like ngrok.
If you starting from scratch I can recommend using a standard Apache + PHP [+ MySql] stack and have a PHP script to interpret and react to the POST request. Of course other script languages (e.g. Python) work just as well.

ngrok - Get all routes to localhost server

I'm using ngrok (free account) in my localhost for my coded web server written in Go
In Ubuntu, after starting my server (which listens on port 3000), I run this command to start ngrok:
./ngrok http 3000
Then other PC can get access to my demo web by path provided by ngrok, for instance, http://6fed323a.ngrok.io
But when they do something on it (for example, click on a button that redirects), the host of URL becomes localhost again
There isn't any functions of ngrok that allows access to all routes in server, is there? I'm learning
I just ran into this issue, the reason for this is because your button uses a straight absolute path redirect which ngrok (or any tunneling service ive used so far) cannot handle. You need to use a relative path redirect such as:
window.location.href = '/path';
In general, it is considered best practice to always use relative urls so that the app is not bound to the hostname. Of course, this is in an ideal work- most legacy apps may not follow this unfortunately.
While I was working on a Rails app I wanted to run it on ngrok but I got error below:
The connection to http://xxxxxx.ngrok.io was successfully tunneled to your ngrok client, but the client failed to establish a connection to the local address localhost:3000.
It seems like ngrok works fine but my local server is not. Which is true since I forgot to run my rails app first by run $ rails s. By doing so I was able to get ngrok tunneing works fine.
Make sure your local server run first.
I have noticed ngrok url changes to localhost url when I click on site logo which is defined as root_path in my route file. But other links and header tabs for example works fine and shows ngrok url.
Good luck.

IIS, IE does not recognize web page protocal

I have a website setup in IIS and i add web application under the website. I publish and copy an existing a .Net web application files (aspx file format) over to the web application folder.
When i try to browse the web page from IE, it says
"Protocol Type: localhost"
"Windows does not recognize this Protocol."
When i try to browse from firefox, it says
"The address wasn't understood"
"Firefox doesn't know how to open this address, because the protocol (localhost) isn't associated with any program."
but when i go to url and click enter (Refresh doesn't work) from firefox, the page works and show the content.
Can anyone please point me the direction of fixing this issue?
Browsers look in the beginning of the URL for the protocol that they should use when opening a specific link (And most have functionality to execute other programs if the protocol is not one they understand).
Normally, the protocol is something like "http:", "ftp:", "file:", "irc:", etcetera.
The protocol is delimited by a colon. Your use of localhost:80/... is tripping the browser into thinking that the protocol you are trying to use is "localhost", which is not correct. If you were to leave the port number out, chances are the browser would assume HTTP with default settings (port 80) and it would work fine, seeing as most browsers will assume HTTP if the protocol is not specified.
"localhost" is not a protocol, it is the name of a server. Your problem is that a colon can serve two functions is a URL: it can separate the protocol from the server, and it can separate the server from the port. You can often leave off the protocol and we assume it is "http". If you have a port number -- "80" in your example -- you must specify the protocol, or we'll confuse the server name for a protocol.
In this example, instead of writing just
localhost:80/AdministrationWebPage/etc
write
http://localhost:80/AdministrationWebPage/etc
If Firefox figures it out, well, good for Firefox, but without the "http://" it's not technically correct.
That is, the general format of a URL is:
protocol://server:port/page?querystring
Browsers and servers will fill in defaults if pieces are missing. But among the rules is that the first colon is supposed to mark the end of the protocol, so:
localhost:80/AdminsitrationWebPage/etc
looks like protocol=localhost, server name=80, which I presume is not what you wanted.
I got the message above too without inserting the forward slash after I install the apache webserver and test the testing.php file in the htdocs folder
The way I solved it is simply to insert the forward slash as follows:
localhost:8000/testing.php
and the content of the testing.php file shows up

Resources