Giter VIP home page Giter VIP logo

python-ngrok's Introduction

python-ngrok

Python bindings for ngrok local and Link APIs

Use with local ngrok setups

If your ngrok server is not running at http://localhost:4040 you need to set your base url like so:

>>> import ngrok
>>> ngrok.client.BASE_URL = "http://localhost:8765"

Tunnels

  • Get all tunnels: ngrok.client.get_tunnels()
  • Get tunnel by ID: ngrok.client.get_tunnel(id)

Requests

Only available on introspected tunnels.

  • Get all requests: ngrok.client.get_requests()
  • Get all requests for a specific tunnel: ngrok.client.get_tunnel(id).get_requests()
  • Get request by ID: ngrok.client.get_request(id)
  • Replay request: ngrok.client.get_request(id).replay()

Use with ngrok link

First set your public ID and secret tokens like so:

>>> import ngrok
>>> ngrok.link.PUBLIC_ID = "my_public_id"
>>> ngrok.link.SECRET_TOKEN = "my_secret_token"

Tunnels

  • Get all tunnels: ngrok.link.get_tunnels()
  • Get tunnel by ID: ngrok.link.get_tunnel(id)

Domains

  • Get all reserved domains: ngrok.link.get_domains()
  • Get reserved domain by ID: ngrok.link.get_domain(id)
  • Reserve new domain: ngrok.link.Domain("mydomain.net").reserve()
  • Release existing reservation: ngrok.link.get_domain(id).release()

TCP Addresses

  • Get all reserved TCP addresses: ngrok.link.get_tcp_addresses()
  • Get reserved TCP address by ID: ngrok.link.get_tcp_address(id)
  • Reserve new TCP address: ngrok.link.Address().reserve()
  • Release existing TCP address reservation: ngrok.link.get_tcp_address(id).release()

Credentials

  • Get all client credentials: ngrok.link.get_credentials()
  • Get client credential by ID: ngrok.link.get_credential(id)
  • Create a new client credential: ngrok.link.Credential(description, acl).create()
  • Revoke an existing client credential: ngrok.link.get_credential(id).revoke()

python-ngrok's People

Contributors

peakwinter avatar

Watchers

a8-jianfeng.chen avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.