Skip to content
This repository has been archived by the owner on Dec 18, 2020. It is now read-only.

alexellis/inlets-heroku-tutorial

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

inlets-heroku-tutorial

Run an inlets server on Heroku.

Conceptual diagram

inlets is a service tunnel and reverse proxy. It can be used to punch out local endpoints to another network, or the Internet.

See inlets/inlets on GitHub.

Deployment

In order to run inlets on Heroku, you can use the container image facility and then set an auth token using Heroku's environment variable store. There is no need to rebuild the whole container from scratch, just inherit the official image and override the CMD.

Push a container image

  • Log into your dahsboard, create an app and get the CLI:

https://dashboard.heroku.com

  • Login:
heroku container:login
  • Deploy:
heroku container:push web -a my-inlets
heroku container:release web -a my-inlets
heroku restart web -a my-inlets
  • Set auth token
export TOKEN=$(head -c 16 /dev/urandom | shasum | cut -f1 -d" ")
echo "Token is: ${TOKEN}"

export HEROKU_APP=my-inlets

heroku config:set TOKEN=${TOKEN} --app $HEROKU_APP
echo $TOKEN > token
  • Run a test server
mkdir -p /tmp/inlets
cd /tmp/inlets
uname > README.md
python -m SimpleHTTPServer
  • Connect the inlets client
export HEROKU_APP="my-inlets"

inlets client \
  --remote wss://${HEROKU_APP}.herokuapp.com \
  --token $(cat token) \
  --upstream http://127.0.0.1:8000
  • Now test the tunnel:
https://${HEROKU_APP}.herokuapp.com/

About

Run inlets on Heroku to tunnel local endpoints for free

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published