{"id":17834797,"url":"https://github.com/animmouse/frp-flyapp","last_synced_at":"2025-08-03T15:42:21.265Z","repository":{"id":37394460,"uuid":"457036295","full_name":"AnimMouse/frp-flyapp","owner":"AnimMouse","description":"Fast reverse proxy on fly.io","archived":false,"fork":false,"pushed_at":"2024-06-11T20:29:36.000Z","size":32,"stargazers_count":100,"open_issues_count":1,"forks_count":16,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-08-07T23:45:25.654Z","etag":null,"topics":["cgnat","expose","firewall","fly","fly-io","flyio","frp","nat","ngrok","ngrok-alternative","proxy","reverse-proxy","tunnel","tunneling"],"latest_commit_sha":null,"homepage":"","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AnimMouse.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-02-08T17:32:36.000Z","updated_at":"2024-08-04T01:44:53.000Z","dependencies_parsed_at":"2023-12-15T09:25:34.571Z","dependency_job_id":"41dfb21f-4804-4792-a504-7568c536d5ab","html_url":"https://github.com/AnimMouse/frp-flyapp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnimMouse%2Ffrp-flyapp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnimMouse%2Ffrp-flyapp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnimMouse%2Ffrp-flyapp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnimMouse%2Ffrp-flyapp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AnimMouse","download_url":"https://codeload.github.com/AnimMouse/frp-flyapp/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246819786,"owners_count":20839095,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cgnat","expose","firewall","fly","fly-io","flyio","frp","nat","ngrok","ngrok-alternative","proxy","reverse-proxy","tunnel","tunneling"],"created_at":"2024-10-27T20:11:27.277Z","updated_at":"2025-04-02T13:12:23.402Z","avatar_url":"https://github.com/AnimMouse.png","language":"Dockerfile","readme":"# frp on fly.io\n[Fast reverse proxy](https://github.com/fatedier/frp) on [fly.io](https://fly.io)\n\nRun your own frp tunnel for free (within free tier) on fly.io\n\n\u003e [!NOTE]\n\u003e On 2024, fly.io will now charge $2/mo for a dedicated IPv4 address, but everything under $5 bill monthly is waved, so if you have 2 or fewer dedicated IPv4, it is still free.\n\nNow you can have ngrok TCP/UDP tunnel with the ports you want, not randomly generated ports on ngrok unless you [pay monthly](https://ngrok.com/pricing).\n\n```mermaid\nflowchart LR\n  User --\u003e |Data Plane| frps\n  frps \u003c--\u003e |Control Plane| frpc\n  subgraph flyapp [fly.io App Server]\n    frps\n  end\n  subgraph ServerNoPublicIP [Server without Public IP]\n    frpc --\u003e Service[TCP, UDP, or HTTP service]\n  end\n```\n\n## fly.io Deployment\n### GitHub Codespaces\n\n1. Fork this repository.\n2. On your own fork, click Code, and click Codespaces tab.\n3. Click \"Create codespace on main\".\n4. Check if frp version in `Dockerfile` is latest, if not, change to the latest version.\n5. Login to flyctl by using `fly auth login` or you can generate [access tokens](https://fly.io/user/personal_access_tokens) and paste it to `FLY_API_TOKEN` in Codespaces secrets.\n6. Create an app on fly.io `fly launch --copy-config --name \u003capp-name\u003e --no-deploy`.\n7. When asked to tweak these settings before proceeding, enter yes if you want to tweak settings like selecting the region closest to you, otherwise, enter no.\n8. Set environment variables for frp server. `fly secrets set -a \u003capp-name\u003e FRP_TOKEN=12345678 FRP_DASHBOARD_PWD=admin`\n9. Deploy to fly.io `fly deploy -a \u003capp-name\u003e --ha=false`.\n10. When asked to allocate a dedicated IPv4 address, enter yes.\n11. Try to connect to frps using the [example frpc.toml](#example-frpctoml).\n\n### Local\nYou need [flyctl](https://github.com/superfly/flyctl) installed.\n\n1. Clone this repository.\n2. Check if frp version in `Dockerfile` is latest, if not, change to the latest version.\n3. Login to flyctl by using `fly auth login`.\n4. Create an app on fly.io `fly launch --copy-config --name \u003capp-name\u003e --no-deploy`.\n5. When asked to tweak these settings before proceeding, enter yes if you want to tweak settings like selecting the region closest to you, otherwise, enter no.\n6. Set environment variables for frp server. `fly secrets set -a \u003capp-name\u003e FRP_TOKEN=12345678 FRP_DASHBOARD_PWD=admin`\n7. Deploy to fly.io `fly deploy -a \u003capp-name\u003e --ha=false`.\n8. When asked to allocate a dedicated IPv4 address, enter yes.\n9. Try to connect to frps using the [example frpc.toml](#example-frpctoml).\n\nDon't forget to change the `\u003capp-name\u003e` and the `FRP_TOKEN` so that others can't use your frp tunnel.\n\nYou can also view `https://\u003capp-name\u003e.fly.dev` in your browser to view the frps dashboard.\n\n## Change server configuration\nType `fly deploy -a \u003capp-name\u003e` on the repository after editing frps.toml\n\n## Switch\nfly.io runs app 24/7, if you are not using your tunnel for a while, it is recommended to suspend it to conserve free tier and resources.\n\n* Suspend frp `fly scale count 0 -a \u003capp-name\u003e`\n* Resume frp `fly scale count 1 -a \u003capp-name\u003e`\n\n## Patched frp to support TCP and UDP tunnel\nSince in fly.io, it is [required to bind to `fly-global-services`](https://fly.io/docs/networking/udp-and-tcp/#your-app-needs-to-bind-to-the-fly-global-services-address) in order for UDP to work, but frp's `proxyBindAddr` only allow to bind in one address, so we patched frp to make its UDP proxy to bind to `fly-global-services`.\n\nIf somehow frp diverged so much that the patch gets broken, just remove the patch on Dockerfile.\n\n## Example frpc.toml\n### KCP Protocol\n[KCP](https://github.com/skywind3000/kcp/blob/master/README.en.md) (a protocol built on UDP) is used by default and to reduce latency (like for game servers).\n\n```toml\nserverAddr = \"\u003capp-name\u003e.fly.dev\"\nauth.token = \"12345678\"\n\n# KCP connection\nserverPort = 7000\ntransport.protocol = \"kcp\"\n\n# QUIC connection\n#serverPort = 7001\n#transport.protocol = \"quic\"\n\n# TCP connection\n#serverPort = 7000\n#transport.protocol = \"tcp\"\n\n# TCP tunnel\n[[proxies]]\nname = \"Minecraft Java\"\ntype = \"tcp\"\nlocalIP = \"127.0.0.1\"\nlocalPort = 25565\nremotePort = 25565\n\n# UDP tunnel\n[[proxies]]\nname = \"Minecraft Bedrock\"\ntype = \"udp\"\nlocalIP = \"127.0.0.1\"\nlocalPort = 19132\nremotePort = 19132\n```\n\n### fly.io free tier\nfly.io requires a credit card in order to work, if you don't have a credit card or if you are afraid that fly.io will charge you so much, it is recommended to buy prepaid credits that can be used with virtual credit cards.\n\n### HTTP tunneling\nIf you are tunneling HTTP apps instead of TCP/UDP, I recommend to just use [Cloudflare Tunnel](https://www.cloudflare.com/products/tunnel/).\\\nYou can also tunnel HTTP apps on this frp by using a custom port like 8080.\\\nIf you need to use standard 80 and 443 port, you need to disable the frps dashboard. Check the [wiki](https://github.com/AnimMouse/frp-flyapp/wiki/HTTP-Tunneling) for tutorial.\n\n### IPv6 support\nIf you have IPv6, congratulations, [you don't need this tunnel](https://www.reddit.com/r/networkingmemes/comments/sif407/imagine_network_engineers_time_gone_into/).\n\nTo allocate IPv6 in fly.io: `fly ips allocate-v6 -a \u003capp-name\u003e`\n\nTo enable IPv6 in control plane, set `bindAddr = \"::\"` in frps.toml. Take note that KCP does not work in IPv6 as [`fly-global-services` does not support IPv6] so you would need to use TCP if you use IPv6 in control plane.\n\nTo enable IPv6 in data plane, set `proxyBindAddr = \"::\"` in frps.toml and `localIP = \"::1\"` in frpc.toml. Take note that UDP does not work in IPv6 as [`fly-global-services` does not support IPv6] so you can't tunnel UDP in IPv6.\n\n[`fly-global-services` does not support IPv6]: https://fly.io/docs/networking/udp-and-tcp/#you-need-a-dedicated-ipv4-address\n\n### More infos\n* [anderspitman/awesome-tunneling](https://github.com/anderspitman/awesome-tunneling)\n\n## 🖕 Carrier-grade Network Address Translation (CGNAT)\n* [Is NAT a conspiracy?](https://chatgptwith.me/posts/is-nat-a-conspiracy/)","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanimmouse%2Ffrp-flyapp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanimmouse%2Ffrp-flyapp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanimmouse%2Ffrp-flyapp/lists"}