Skip to main content

How to expose your local server to Internet?

As a developer, we always have a wish to expose our work to internet, so that we can show those to our friends or teachers for testing. But, what we choose to use services of public cloud and sometimes it becomes a bit more expensive way for small projects.
So, friends I have found a way to expose your localhost services to the internet without port forwarding through the NAT of your ISP.

The solution is: NGROK

What is ngrok?

Ngrok exposes local servers behind NATs and firewalls to the public internet over secure tunnels.

How it works

You download and run a program on your machine and provide it the port of a network service, usually a web server. It connects to the ngrok cloud service which accepts traffic on a public address and relays that traffic through to the ngrok process running on your machine and then on to the local address you specified.

What it's good for

  • Demoing web sites without deploying
  • Building webhook consumers on your dev machine
  • Testing mobile apps connected to your locally running backend
  • Stable addresses for your connected devices that are deployed in the field
  • Running personal cloud services from your home

A few great features

Secure Tunnels
Instantly create a public HTTPS URL for a web site running locally on your development machine.

ngrok http 80


Fast
ngrok tunnels run using an optimized version of the technology that powers HTTP/2 so that your tunneled services load fast.

Password Protected
Set http auth credentials to protect access to your tunnel and those you share it with.

ngrok http -auth "user:password" 80


Websocket Support
Share your real-time web apps! ngrok tunnels websocket connections over HTTP tunnels without any changes.

ngrok http 8000


Replay Webhook Requests
Easily develop webhook integrations by simply 'replaying' webhook requests to your dev server.

Automate ngrok via API
Dynamically start, stop and query tunnel status all with a simple RESTful API.

curl http://127.0.0.1:4040/api/


Request Inspection
Use ngrok's web inspection interface to understand the HTTP request and response traffic over your tunnel.

http://localhost:4040


No more port forwarding
Don't configure port forwarding on your router or waste time setting up dynamic DNS solutions. ngrok works everywhere with no changes, even when a device changes networks.

TCP Tunnels
Expose any networked service to the internet, even ones that don't use HTTP like SSH.

ngrok tcp 22


Multiple Simultaneous Tunnels
Run multiple tunnels simultaneously with a single ngrok client.

ngrok start demo-site ssh admin-ui


Target virtual-host sites
Rewrite the Host header of tunneled requests to target a specific site in your WAMP/MAMP/Pow development environment.

ngrok http -host-header=mysite.dev 80


Shared account access for teams
Accounts can share access to reserved domains and addresses allowing multiple developers to collaborate on a project while still having their own credentials.

Download it from here: https://ngrok.com/download

Notes:
For linux execute ngrok by: ./ngrok [attr.]

Src: https://ngrok.com/

Comments

Post a Comment

Popular posts from this blog

Ceph Single Node Setup Ubuntu

Single Node Ceph Install A quick guide for installing Ceph on a single node for demo purposes. It almost goes without saying that this is for tire-kickers who just want to test out the software. Ceph is a powerful distributed storage platform with a focus on spreading the failure domain across disks, servers, racks, pods, and datacenters. It doesn’t get a chance to shine if limited to a single node. With that said, let’s get on with it. Inspired from:  http://palmerville.github.io/2016/04/30/single-node-ceph-install.html Hardware This example uses a VMware Workstation 11 VM with 4 disks attached (1 for OS/App, 3 for Storage). Those installing on physical hardware for a more permanent home setup will obviously want to increase the OS disks for redundancy. To get started create a new VM with the following specs: ·         Name: ceph-single-node ·         Type: Linux ·         Version: Ubuntu 16.04.03 (64-bit) ·         Memory: 4GB ·         Disk: 25GB (Dynamic) ·

Docker Overview

OVERVIEW Docker is the company driving the container movement and the only container platform provider to address every application across the hybrid cloud. Today’s businesses are under pressure to digitally transform but are constrained by existing applications and infrastructure while rationalizing an increasingly diverse portfolio of clouds, datacenters and application architectures. Docker enables true independence between applications and infrastructure and developers and IT ops to unlock their potential and creates a model for better collaboration and innovation. A little intro to LXC: - LXC (LinuX Containers) is a OS-level virtualization technology that allows creation and running of multiple isolated Linux virtual environments (VE) on a single control host. These isolation levels or containers can be used to either sandbox specific applications, or to emulate an entirely new host. LXC uses Linux’s cgroups functionality, which was introduced in version 2.6.24 to