Convert Figma logo to code with AI

inconshreveable logongrok

Unified ingress for developers

24,128
4,264
24,128
0

Top Related Projects

84,231

A fast reverse proxy to help you expose a local server behind a NAT or firewall to the internet.

Minimal, self-hosted, 0-config alternative to ngrok. Caddy+OpenSSH+50 lines of Python.

4,520

Applicative Protocol Multiplexer (e.g. share SSH and HTTPS on the same port)

Fast and secure tunnels over HTTP/2

12,696

A fast TCP/UDP tunnel over HTTP

8,424

🕳 bore is a simple CLI tool for making tunnels to localhost

Quick Overview

ngrok is a powerful tool that creates secure tunnels to expose local servers to the internet. It allows developers to easily share and test web applications, APIs, and other services running on their local machines without the need for complex network configurations or public IP addresses.

Pros

  • Easy to set up and use, with a simple command-line interface
  • Provides secure HTTPS tunnels without requiring SSL certificates
  • Offers real-time inspection of HTTP traffic for debugging
  • Supports custom subdomains and TCP tunneling

Cons

  • Free tier has limitations on features and concurrent tunnels
  • Paid plans can be expensive for individual developers or small teams
  • Reliance on a third-party service for exposing local servers
  • May face occasional downtime or performance issues

Getting Started

  1. Download ngrok from the official website: https://ngrok.com/download
  2. Extract the downloaded file and move the ngrok executable to a convenient location
  3. Open a terminal and navigate to the directory containing ngrok
  4. Run the following command to start a tunnel for a local web server on port 8080:
./ngrok http 8080
  1. ngrok will display a public URL that you can use to access your local server
  2. To use custom subdomains or other features, sign up for a free account and add your authtoken:
./ngrok authtoken YOUR_AUTH_TOKEN
  1. For more advanced usage, refer to the ngrok documentation: https://ngrok.com/docs

Competitor Comparisons

84,231

A fast reverse proxy to help you expose a local server behind a NAT or firewall to the internet.

Pros of frp

  • Open-source and self-hosted, offering more control and customization
  • Supports multiple protocols (TCP, UDP, HTTP, HTTPS, STCP)
  • Allows for more complex configurations and advanced features

Cons of frp

  • Requires more technical knowledge to set up and configure
  • Less user-friendly interface compared to ngrok
  • May require additional server resources for self-hosting

Code Comparison

frp configuration example:

[common]
server_addr = x.x.x.x
server_port = 7000

[ssh]
type = tcp
local_ip = 127.0.0.1
local_port = 22
remote_port = 6000

ngrok configuration example:

authtoken: your_auth_token
tunnels:
  ssh:
    proto: tcp
    addr: 22

Both projects aim to provide secure tunneling services, but frp offers more flexibility and control at the cost of increased complexity. ngrok provides a simpler, more user-friendly experience with its managed service approach. The choice between the two depends on specific requirements, technical expertise, and desired level of control over the tunneling infrastructure.

Minimal, self-hosted, 0-config alternative to ngrok. Caddy+OpenSSH+50 lines of Python.

Pros of SirTunnel

  • Open-source and self-hosted, providing more control over data and infrastructure
  • Lightweight and simple to set up, with minimal dependencies
  • Designed for personal use, making it easier to customize for specific needs

Cons of SirTunnel

  • Less feature-rich compared to ngrok, lacking advanced functionalities
  • Limited documentation and community support
  • May require more technical knowledge to set up and maintain

Code Comparison

SirTunnel:

async def handle_client(reader, writer):
    remote_reader, remote_writer = await asyncio.open_connection(
        '127.0.0.1', LOCAL_PORT)
    await asyncio.gather(
        pipe(reader, remote_writer),
        pipe(remote_reader, writer)
    )

ngrok:

func (c *Tunnel) Start() (err error) {
    c.conns = make(chan conn.Conn)
    go c.manager()
    return c.listen()
}

The code snippets show that SirTunnel uses Python's asyncio for handling connections, while ngrok is implemented in Go, utilizing goroutines for concurrent operations. SirTunnel's code appears more straightforward, reflecting its simpler design, while ngrok's code hints at a more complex architecture with separate connection management and listening processes.

4,520

Applicative Protocol Multiplexer (e.g. share SSH and HTTPS on the same port)

Pros of sslh

  • Open-source and self-hosted, providing more control over infrastructure
  • Supports multiplexing multiple protocols (SSH, HTTPS, OpenVPN) on a single port
  • Lightweight and efficient, with minimal resource usage

Cons of sslh

  • Requires more technical knowledge to set up and configure
  • Limited to local network or self-hosted environments
  • Lacks built-in features like authentication and metrics

Code Comparison

sslh configuration example:

listen:
(
    { host: "0.0.0.0"; port: "443"; }
);
protocols:
(
     { name: "ssh"; service: "ssh"; host: "localhost"; port: "22"; },
     { name: "tls"; host: "localhost"; port: "8443"; }
);

ngrok configuration example:

authtoken: YOUR_AUTH_TOKEN
tunnels:
  webapp:
    proto: http
    addr: 8080
  ssh:
    proto: tcp
    addr: 22

sslh focuses on protocol multiplexing, while ngrok provides a more user-friendly approach to exposing local services to the internet. sslh is better suited for self-hosted environments with multiple services, whereas ngrok excels in quickly creating public endpoints for development and testing purposes.

Fast and secure tunnels over HTTP/2

Pros of go-http-tunnel

  • Written in Go, offering better performance and lower resource usage
  • Simpler and more lightweight, focusing specifically on HTTP tunneling
  • Easier to integrate into existing Go projects

Cons of go-http-tunnel

  • Less feature-rich compared to ngrok's extensive functionality
  • Smaller community and ecosystem support
  • Limited documentation and examples available

Code Comparison

ngrok (Python):

from pyngrok import ngrok

public_url = ngrok.connect(8000)
print(f"Public URL: {public_url}")

go-http-tunnel (Go):

import "github.com/mmatczuk/go-http-tunnel"

tunnel := tunnel.NewServer(&tunnel.ServerConfig{
    Addr: ":8000",
})
tunnel.Start()

Summary

go-http-tunnel is a lightweight, Go-based alternative to ngrok, offering better performance and easier integration into Go projects. However, it lacks the extensive features and community support of ngrok. ngrok provides a more comprehensive tunneling solution with additional functionality, while go-http-tunnel focuses specifically on HTTP tunneling with a simpler approach. The choice between the two depends on the specific requirements of your project and the desired level of functionality.

12,696

A fast TCP/UDP tunnel over HTTP

Pros of Chisel

  • Open-source and self-hosted, offering more control and customization
  • Supports both TCP and UDP tunneling
  • Includes built-in SSH server functionality

Cons of Chisel

  • Less user-friendly setup compared to ngrok's simplicity
  • Smaller community and fewer resources available
  • May require more technical knowledge to configure and use effectively

Code Comparison

Chisel server setup:

chisel server --port 8080 --reverse

ngrok setup:

ngrok http 8080

Key Differences

  • Chisel is primarily designed for reverse tunneling, while ngrok focuses on exposing local servers to the internet
  • ngrok offers a managed service with additional features like custom domains and analytics
  • Chisel provides more flexibility for advanced networking scenarios but requires more configuration

Use Cases

Chisel is better suited for:

  • Self-hosted environments
  • Complex networking setups
  • Scenarios requiring both TCP and UDP tunneling

ngrok is preferable for:

  • Quick and easy setup for exposing local servers
  • Developers needing a managed solution with minimal configuration
  • Projects requiring additional features like custom domains and request inspection

Both tools serve similar purposes but cater to different user needs and technical requirements.

8,424

🕳 bore is a simple CLI tool for making tunnels to localhost

Pros of bore

  • Open-source and self-hostable, offering more control and customization
  • Lightweight and simple to use, with minimal dependencies
  • Written in Rust, providing better performance and memory safety

Cons of bore

  • Less feature-rich compared to ngrok (e.g., lacks advanced authentication options)
  • Smaller community and ecosystem, potentially leading to fewer resources and integrations
  • May require more manual configuration for complex setups

Code comparison

bore:

use tokio::net::TcpListener;
use tokio::io::{AsyncReadExt, AsyncWriteExt};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let listener = TcpListener::bind("127.0.0.1:8080").await?;
    // ... (additional code)
}

ngrok:

package main

import (
    "net/http"
    "github.com/inconshreveable/ngrok/ngrok"
)

func main() {
    http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
        // ... (request handling code)
    })
    ngrok.Listen(ngrok.Config{Addr: ":8080"})
}

Both projects aim to provide tunneling solutions, but bore focuses on simplicity and performance, while ngrok offers a more comprehensive feature set. bore is ideal for developers who prefer open-source solutions and want more control, while ngrok may be better suited for those requiring a robust, battle-tested platform with extensive features and support.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

ngrok - Unified Ingress for Developers

https://ngrok.com

ngrok Community on GitHub

If you are having an issue with the ngrok cloud service please open an issue on the ngrok community on GitHub

This repository is archived

This is the GitHub repository for the old v1 version of ngrok which was actively developed from 2013-2016.

This repository is archived: ngrok v1 is no longer developed, supported or maintained.

Thank you to everyone who contributed to ngrok v1 it in its early days with PRs, issues and feedback. If you wish to continue development on this codebase, please fork it.

ngrok's cloud service continues to operate and you can sign up for it here: https://ngrok.com/signup

What is ngrok?

ngrok is a globally distributed reverse proxy that secures, protects and accelerates your applications and network services, no matter where you run them. You can think of ngrok as the front door to your applications. ngrok combines your reverse proxy, firewall, API gateway, and global load balancing into one. ngrok can capture and analyze all traffic to your web service for later inspection and replay.

To use ngrok, sign up at https://ngrok.com/signup

ngrok open-source development

ngrok continues to contribute to the open source ecosystem at https://github.com/ngrok with:

What is ngrok for?

What can you do with ngrok?

  • Site-to-site Connectivity: Connect securely to APIs and databases in your customers' networks without complex network configuration.
  • Developer Previews: Demoing an app from your local machine without deploying it
  • Webhook Testing: Developing any services which consume webhooks (HTTP callbacks) by allowing you to replay those requests
  • API Gateway: An global gateway-as-a-service that works for API running anywhere with simple CEL-based traffic policy for rate limiting, jwt authentication and more.
  • Device Gateway: Run ngrok on your IoT devices to control device APIs from your cloud
  • Debug and understand any web service by inspecting the HTTP traffic to it