Skip to content

Setup FRP server on Heroku and Client on Local (Ubuntu currently). Support FRP server on Ubuntu as well and other alternatives.

Notifications You must be signed in to change notification settings

scjxd/FRP-Heroku

 
 

Repository files navigation

FRP Heroku

Setup FRP server on Heroku and Client on Local (Ubuntu currently). Support FRP server on Ubuntu as well and other alternatives.

Note:

Currently, we need two ports to build communication between frps and frpc, but Heroku don't support self-defined port...

Heroku (Skip this currently...)

Setup Heroku CLI

# Install on Ubuntu
sudo snap install --classic heroku

# Check Installation
heroku --version

# Login
heroku login

heroku.yml

app.json

Deploy Note

IMPORTANT: Heroku dynamically assigns your app a port, so you can't set the port to a fixed number.

Deploy Button

Dyno

Useful Command

# View logs
$ heroku logs --tail

# List the dynos for an app
$ heroku ps
Free dyno hours quota remaining this month: 550h 0m (100%)
Free dyno usage for this app: 0h 0m (0%)
For more information on dyno sleeping and how to upgrade, see:
https://devcenter.heroku.com/articles/dyno-sleeping

# If an app is down, you can restart it (assume it's web.1)
heroku restart web.1

FRP

FRP Server - Heroku

This is the server you want to use as a springboard

# Create new app
$ heroku create your-server-name
Creating ⬢ your-server-name... done
https://your-server-name.herokuapp.com/ | https://git.heroku.com/your-server-name.git

# Stack the app to `container`
heroku stack:set container
# Check current git remote
git remote -v

# Upload changes to Github
git push origin master
# Upload changes to Heroku
git push heroku master

Check the logs to see if the survice is running, and because Heroku automatically bind the port, so you may want to check the port so that you can set the frpc.ini

heroku logs --app=your-server-name

Server setting

...

If want to use the docker for Heroku outside of Heroku, remember to add -e PORT=7000 argument and open necessary ports (e.g. 7000, 6000)

FRP Client - Ubuntu

This is the computer you want to connect to

# Setup binary executables
bash get_frp_local.sh

Now you should be able to use frps and frpc.

Change settings in frpc.ini to your heroku address.

# Start client
frpc -c frpc.ini

better run with tmux

Setup Systemd Service to Auto Start on Reboot (optional but recommend)

# Copy configure file and start frpc
bash setup_frp_client_systemd.sh
# Stop service
systemctl stop frpc.service

FRP Server - Ubuntu

This is the server you want to use as a springboard

cd UbuntuFRPServer

Using Docker

# Install docker first (https://gist.github.com/daviddwlee84/9ba69aa231a19be54b6f09ae0d158683#file-install_docker-sh)
bash install_docker.sh
# Build docker image
docker build -t frp .

# Run server
docker run -d -p 7000:7000 -p 6000:6000 -p 7500:7500 frp

Using Directly

Assume you already got frps binaries, otherwise checkout here.

# Start server
frps -c frps.ini

better run with tmux

Using Systemd Service

# Copy configure file and start frps
bash setup_frp_server_systemd.sh
# Stop service
systemctl stop frps.service
# After modify /etc/frpc.ini, restart the frpc
systemctl restart frpc.service

How to Connect

Connect SSH

ssh -oPort=6000 username@frp-server-ip-address
# equivalent
ssh -p 6000 username@frp-server-ip-address

FRP Dashboard

If you setup with FRP Server - Ubuntu

Go to https://frp-server-ip-address:7500 and login with admin for both account and password.

Alternatives

Expose necessary port without using FRP

Ngrok

Check out here.

Applications

Todo

  • Open port for other services
  • Docker for frpc?!

Resources

Example

Heroku

General

Official

Notes for Alternatives

Other Tools for Reverse Proxy / NAT Traversal / Intranet Penetration

Deploy

Other

git update-index --assume-unchanged frpc.ini

About

Setup FRP server on Heroku and Client on Local (Ubuntu currently). Support FRP server on Ubuntu as well and other alternatives.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 53.3%
  • Dockerfile 46.7%