We've already talked a lot about Ngrok, now it's time to share instructions on how to create a tunnel. This is an important feature that you may need while working with the software, which will make your life much easier. Let's go through how it can be done.
To create a local HTTP port from the outside, use the http command. To do this, simply specify the port as a parameter, for example for port 80:
$ ngrok http 80
As soon as the tunnel starts its work in the terminal will appear information about its status. In the Forwarding field it will not be difficult to find the URL, It is this URL that you will be able to access the service. During the first launch Ngrok will warn you that this resource is accessible via Ngrok.
All you have to do is click Visit Site:
Next, the server and the content of the site will become available:
HTTP authorization should be added to allow other users to access the site. There is the following option that allows you to do this --basic-auth
:
ngrok http --basic-auth="user:password" 80
You will then need to enter a password to access the site. If you need to specify Host for your local site, this can be done with the --host-header
option. For example, to change the domain to example.local
, use this command:
ngrok http --host-header="example.local" 80
By default, the service will be accessible externally via HTTPS. If you want it to be accessible only via HTTP use the --scheme
option. For example:
ngrok http --scheme="http" 80
If you want to make the port available on another machine, specify its IP address along with the port. For example, for 192.168.1.143:
ngrok http 192.168.1.143:80
We figured out how to create a tunnel, now you know even more about Ngrok!
Apply the discount by inserting the promo code in the special field at checkout: