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...
# Install on Ubuntu
sudo snap install --classic heroku
# Check Installation
heroku --version
# Login
heroku login
- Building Docker Images with heroku.yml | Heroku Dev Center
- heroku.yml build manifest is now available (developer preview) | Heroku Dev Center
IMPORTANT: Heroku dynamically assigns your app a port, so you can't set the port to a fixed number.
- Why is my Node.js app crashing with an R10 error? - Heroku Help
- Heroku + node.js error (Web process failed to bind to $PORT within 60 seconds of launch) - Stack Overflow
- docker - How do I expose ports on Heroku with a Dockerfile? - Stack Overflow
- How do I use the $PORT environment variable in container based apps? - Heroku Help
- Container Registry & Runtime (Docker Deploys) | Heroku Dev Center
- Heroku + node.js: I have a server which uses multiple ports. How can I get Heroku to allocate them? - Stack Overflow
- Like Heroku but allows use of two ports? : webdev
Deploy Button
- Heroku Dynos | Heroku
- Dynos (app containers) | Heroku Dev Center
- Heroku Exec (SSH Tunneling) | Heroku Dev Center
# 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
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)
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
This is the server you want to use as a springboard
cd UbuntuFRPServer
# 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
Assume you already got
frps
binaries, otherwise checkout here.
# Start server
frps -c frps.ini
better run with
tmux
# 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
Connect SSH
ssh -oPort=6000 username@frp-server-ip-address
# equivalent
ssh -p 6000 username@frp-server-ip-address
If you setup with FRP Server - Ubuntu
Go to https://frp-server-ip-address:7500
and login with admin
for both account and password.
Expose necessary port without using FRP
Check out here.
- TeamViewer
- Hamachi
- Open port for other services
- Docker for
frpc
?!
Heroku
General
Official
- Top 5 Alternatives to Heroku | Back4App Blog
- Heroku Alternatives — Top 5 Picks - Brenda Clark - Medium
- Keep file in a Git repo, but don't track changes - Stack Overflow
- git - Add ignored file to repo but don't track afterwards - Stack Overflow
git update-index --assume-unchanged frpc.ini