What is ngrok?
Published: 2023-11-24 09:16:09

ngrok is a cross-platform application that enables developers to expose a local development server to the Internet with minimal effort. The software makes your locally-hosted web server appear to be hosted on a subdomain of ngrok.com, meaning that no public IP or domain name on the local machine is needed. Similar functionality can be achieved with Reverse SSH Tunneling, but this requires more setup as well as hosting of your own remote server.

Ngrok pricing
-------------

Ngrok has a free pricing tier for developers who are bringing new projects to life. The downside to the free tier is the lack of custom domain support.

How does ngrok work?
--------------------

ngrok is able to bypass NAT Mapping and firewall restrictions by creating a long-lived [TCP](https://www.pubnub.com/guides/tcp-ip/) tunnel from a randomly generated subdomain on ngrok.com (e.g. 3gf892ks.ngrok.com) to the local machine.

After specifying the port that your web server listens on, the ngrok client program initiates a secure connection to the ngrok server and then anyone can make requests to your local server with the unique ngrok tunnel address. The [ngrok developer's guide](https://github.com/inconshreveable/ngrok/blob/master/docs/DEVELOPMENT.md) contains more detailed information on how it works.

What is ngrok tunneling?
------------------------

Various tunnel servers are available around the world and locations include: US (Ohio), Europe (Frankfurt), Asia (Singapore), and Australia (Sydney). Alternatively, the ngrok server software can be self-hosted on a VPS or dedicated server.

How to use ngrok?
-----------------

By default, ngrok creates both [HTTP](https://www.pubnub.com/guides/http/) and HTTPS endpoints, making it useful for testing integrations with third-party services or APIs that require valid [SSL/TLS](https://www.pubnub.com/guides/ssl-tls/) domains. Other use cases include: quickly showcasing local demos to clients, testing mobile application backends, and running personal cloud services from your home PC.

One praised feature of ngrok is the ability to track and replay HTTP requests via ngrok's web console . The replay functionality is highly useful when testing API calls or [webhooks](https://www.pubnub.com/guides/webhooks/) as one can easily inspect all header content and request/response data in one place via the console UI.

A premium version of ngrok, ngrok link, is available for developers to use in production and offers features such as API automation and credential management, making it suitable for remote IoT management in a professional setting.

Ngrok Security
--------------

**Ngrok is a highly secure platform for remote access and is safe to use**. Ngrok provides tunneling, as mentioned above, which enables users to access local-hosted servers from outside the machine.

Do hackers use ngrok?
---------------------

Ngrok is regularly abused by hackers for cyber attacks. Hackers choose ngrok because of its capabilities and reputation to maneuver while bypassing security protocols. They will see this as a way to complete a phishing attack, as they are able to create fake login pages or deliver malicious URLs.

Resources
---------

-   [Http Stream and Http Data](https://www.pubnub.com/guides/what-is-http-streaming/ )
    
-   [Http 3 Info](https://www.pubnub.com/guides/http-3/)
    

How can PubNub help you?
========================

This article was originally published on [PubNub.com](https://pubnub.com/guides/what-is-ngrok/)

Our platform helps developers build, deliver, and manage real-time interactivity for web apps, mobile apps, and IoT devices.

The foundation of our platform is the industry's largest and most scalable real-time edge messaging network. With over 15 points-of-presence worldwide supporting 800 million monthly active users, and 99.999% reliability, you'll never have to worry about outages, concurrency limits, or any latency issues caused by traffic spikes.

Experience PubNub
-----------------

Check out [Live Tour](https://www.pubnub.com/tour/introduction/) to understand the essential concepts behind every PubNub-powered app in less than 5 minutes

Get Setup
---------

Sign up for a [PubNub account](https://admin.pubnub.com/signup/) for immediate access to PubNub keys for free

Get Started
-----------

The [PubNub docs](https://www.pubnub.com/docs) will get you up and running, regardless of your use case or [SDK](https://www.pubnub.com/docs)