Skip to content

Latest commit

 

History

History
52 lines (38 loc) · 1.24 KB

File metadata and controls

52 lines (38 loc) · 1.24 KB

ngrok Python SDK Quickstart

A minimal Python app demonstrating the ngrok Python SDK.

What you'll need

Setup

  1. Install dependencies:

    pip install -r requirements.txt
  2. Create a .env file from the example:

    cp .env.example .env
  3. Add your ngrok auth token to the .env file:

    NGROK_AUTHTOKEN=your_actual_authtoken_here
  4. Reserve a domain in the ngrok dashboard and add it to the .env file:

    NGROK_RESERVED_DOMAIN=your_actual_authtoken_here

Running the app

  1. Start the Python service:

    python service.py
  2. In another terminal, start the ngrok agent endpoint:

    python endpoint.py

The ngrok agent endpoint will output a URL that forwards traffic to your local app.

Files

  • service.py - Basic Python HTTP server
  • endpoint.py - ngrok agent endpoint configuration with OAuth
  • .env.example - Environment variable template
  • requirements.txt - Python dependencies