ffp
ffp copied to clipboard
yet another Flask File Proxy | 文件代理
👉👉👉YUX/gfp
ffp
yet another Flask File Proxy
:rocket:QUICK START
~~If you can see the little badge here --> []. The proxy is ON.~~
This badge is not on due to regulation. Please check the SELF-HOST part.
Let's say you want to use the Docker Install Script:
curl -fsSL https://get.docker.com -o get-docker.sh
sh get-docker.sh
But due to the special network environment that you may have encountered, that you cannot communicate with https://get.docker.com properly. Then you should try this instead:
curl -fsSL https://ffp.yux.io/https://get.docker.com -o get-docker.sh
sh get-docker.sh
Then the get-docker.sh comes to you via ffp now, while there is another problem you must have noticed already that
there are a lot of other outer resources from that very script, such as https://github.com/docker......
, http://ftp.debian.org/...... and they happen to be all unreachable from you. So let's rewrite all urls inside the script to the ffp address. (please note /r/ in the url)
curl -fsSL https://ffp.yux.io/r/https://get.docker.com -o get-docker.sh
sh get-docker.sh
:neckbeard:SELF-HOST (RECOMMENDED)
Since there is no guarantee for the domain ffp.yux.io to work constantly. I imagine this would take tremendous
amount of bandwidth. So I recommend you to deploy ffp on your own server.
:pager:INSTALLATION
- install ffp via docker
docker run -d --name=ffp \
-p 127.0.0.1:502:80 \
--restart=always \
yuxio/ffp:latest
-
Point your domain or subdomain to local
502port. (reverse proxy such as caddy, nginx, frp, Apache…) -
Get the HTTPS work
:trollface:USAGE
-
File Proxy
- Rewrite
https://get.docker.comtohttps://your.domain.here/https://get.docker.com - Now you get the file passed through the ffp.
- Rewrite
-
Rewritten Script Proxy please note
/r/in the url- Rewrite
https://get.docker.comtohttps://your.domain.here/r/https://get.docker.com - This will replace all the URL in the script to
https://your.domain.here/URL, which means you'd get all the resources passing through your proxy.
- Rewrite
:japanese_goblin:OTHER
- If you don't have a domain, use
docker run -d --name=ffp -p 80:80 yuxio/ffp:latest, then rewritehttps://get.docker.comtohttp://$IP/https://get.docker.com, it should work just fine. But you can't use Rewritten Script Proxy. - If you don't want to use docker, clone this repository then
run
pip install -r requirements.txt && python main.py --host=0.0.0.0 --port=$PORT, choose the port you want. Rewritehttps://get.docker.comtohttp://$IP:$PORT/https://get.docker.com. you need a proper python-3.7.6 environment
ffp
使用Flask制作的文件代理
:rocket:原地开始
~~你要是能看见这有个小图标 --> [], 代理网站(ffp.yux.io)在线。~~
ffp.yux.io 已下线,请自行部署😂
比如你想用 Docker Install Script:
curl -fsSL https://get.docker.com -o get-docker.sh
sh get-docker.sh
但是由于可能存在的特殊网络环境,访问 https://get.docker.com并不通畅,试一下这个:
curl -fsSL https://ffp.yux.io/https://get.docker.com -o get-docker.sh
sh get-docker.sh
这样脚本就通过ffp访问。但是这就带来了另一个问题,脚本中有些外部资源,像 https://github.com/docker......, http://ftp.debian.org/......
依然无法访问,这时就需要重写脚本中的外部链接,使所有外部资源都通过ffp。
curl -fsSL https://ffp.yux.io/r/https://get.docker.com -o get-docker.sh
sh get-docker.sh
:neckbeard:建议自行部署
不能保证ffp.yux.io一定能持续正常工作,建议使用docker自行部署。
:pager:安装
- 通过docker部署ffp
docker run -d --name=ffp \
-p 127.0.0.1:502:80 \
--restart=always \
yuxio/ffp:latest
没有报错的话,此时ffp就部署成功了,监听本地的502端口。
-
将你的域名,或者子域名绑定到本地的502端口。
-
部署你的HTTPS。
:trollface:用法
-
文件代理
- 把你想要获取的文件地址前加上你的域名,例如,将
https://get.docker.com改成https://your.domain.here/https://get.docker.com - 这样这个脚本就会通过ffp代理,即时文件的原地址在你目前所处的网络环境下无法访问,也可以通过ffp正常访问。
- 把你想要获取的文件地址前加上你的域名,例如,将
-
重写外部链接 注意链接中的
/r/- 将
https://get.docker.com重写为https://your.domain.here/r/https://get.docker.com - 这样脚本中的外部链接被重写为通过ffp的链接。
- 将
:japanese_goblin:其他
- 如果你没有域名,可以这样部署
docker run -d --name=ffp -p 80:80 yuxio/ffp:latest, 然后把你想要访问的链接,例如https://get.docker.com改成http://$IP/https://get.docker.com, 这样就可以了,但是无法重写脚本中的外部链接。 - 如果不想使用docker,也可以直接运行,ffp
目前仅在python-3.7.6版本中测试通过。
pip install -r requirements.txt && python main.py --host=0.0.0.0 --port=$PORT, 选择端口,一般使用80端口。 将https://get.docker.com重写为http://$IP:$PORT/https://get.docker.com。