Coder Social home page Coder Social logo

lgtm-migrator / ngrok-fork Goto Github PK

View Code? Open in Web Editor NEW

This project forked from soontao/ngrok-fork

0.0 0.0 0.0 858 KB

This is a forked project for ngrok, make its easier to use.

License: Other

Shell 0.76% JavaScript 21.73% Go 71.39% Makefile 0.91% HTML 4.59% Dockerfile 0.63%

ngrok-fork's Introduction

ngrok project

CircleCI Snapshot Build Docker Cloud Automated build

This is a fork project for ngrok, make its easier to use.

SECURITY ALERT

PLEASE READ THIS PARAGRAPH FIRST, VERY IMPORTANT !!!

To simplify the ngrok client build/usage, the tls verify logic will be skipped, so your traffic is in-secure, please DO NOT use this service to transfer sensitive/production data.

The server will generate a self-signed ssl cert as its tls encryption cert, and client will connect to server without ssl chain verify (but still transfer data under tls protection), in this solution, the users of self hosted service doesn't need to build the client/server again and again.

Client install & Usage

download binary from snapshot build

then start your tunnel with command

ngrok --serveraddr self_host_domain.com:4443 81
  • the serveraddr is mandatory for your own server
    • format: self_host_domain:transfer_port, defaultly, the transfer port should be 4443
    • your service provider will tell you the serviceaddr
  • the second parameter 81 is your local service port
    • format is same with serviceaddr
    • you can expose any services in your local network like 192.168.3.24:3000

another way: just run docker build -t ngrok -f client.Dockerfile . to build ngrok client image

Server setup

run following command in your server

docker run --name ngrokd -d --restart=always -p 4080:80 -p 4443:4443 -e DOMAIN=self_host_domain.com theosun/ngrok-fork
  • you must create domain & sub-domain DNS records for your server firstly
    • self_host_domain.com -> your server ip
    • *.self_host_domain.com -> your server ip
  • the DOMAIN environment variable is mandatory
    • DOMAIN env should be the root domain of your server, like self_host_domain.com
  • port 4080, the http service port
  • port 4443, the ngrok transfer port, the client users need to get this port to setup their tunnels
  • setup reverse proxy for the ngrok http service port

Get a wildcard cert for your domain

(first of first, you should have your own domain)

just ref this doc

Server example reverse proxy config (for caddy server v1)

*.your_host_domain:443 {
  gzip
  proxy / http://127.0.0.1:4080 {
    transparent
    websocket
  }
  tls wildcardcertpath wildcardcertkeypath
}

for other server like nginx, you can find many many docs from search engine.

Icon

Icons made by Freepik from www.flaticon.com

ngrok-fork's People

Contributors

inconshreveable avatar soontao avatar nickpresta avatar cespare avatar ojongerius avatar skastel avatar vincentbernat avatar frankstratton avatar kyleconroy avatar philips avatar davej avatar fcarriedo avatar jkeesh avatar marcuscreo avatar pborreli avatar rjocoleman avatar thurloat avatar vroy avatar cnelson avatar dependabot-preview[bot] avatar mattn avatar tifayuki 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.