Fly.io介绍
Fly.io是一个服务端云平台,可以实现持续集成、持续部署,主要提供Docker运行环境和一些基础设施服务。免费提供3台1c256m的机器,可提供https的443端口访问,因此我们可以利用这些机器,加上xray的h2协议搭建一条跨出边界的通道。
详细介绍参考文章:http://halo.hezhijie.com/archives/1701918971556
注册&安装
照着官网的使用手册进行安装即可
安装手册如下:https://fly.io/docs/hands-on/install-flyctl/
梯子
这里使用xray作为通道
xray介绍如下:https://xtls.github.io/document/
图形化客户端:
OpenWrt
Windows
Android
iOS / macOS(使用 ARM 芯片)
macOS(X86 芯片 / ARM 芯片)
使用fly安装x2ray
准备
下载配置文件,并解压,例如解压到D:/data目录下
修改fly.toml文件,修改里面app的值,这个必须是唯一的,建议增加上自己的标识,防止跟别人的重复了。重复了会创建失败。这个值很重要,后续都会用到。
3. 修改config.json的配置中的host配置,将yk-x2ray修改成刚才设置的app的值。
4. 记住config.json中的这个id值,这个就是用户id,可以自行修改,但长度得一样。需要配置到客户端的用户id中
执行
进入上面的解压目录,按住shift,鼠标右键文件夹空白处,选择在终端中打开
在弹出的命令行中输入以下命令,运行应用。运行失败重复执行的,使用flyctl deploy
flyctl launch
会提示是否创建应用, 一般输入y即可
[root@vultr fly-xray]# fly launch
An existing fly.toml file was found for app yk-x2ray
? Would you like to copy its configuration to the new app? (y/N)
Scanning source code
Detected a Dockerfile app
Creating app in /root/xray/docker/fly-xray
We're about to launch your app on Fly.io. Here's what you're getting:
Organization: 814495656@qq.com (fly launch defaults to the personal org)
Name: yk-x2ray (from your fly.toml)
Region: Los Angeles, California (US) (from your fly.toml)
App Machines: shared-cpu-1x, 1GB RAM (most apps need about 1GB of RAM)
Postgres: <none> (not requested)
Redis: <none> (not requested)
? Do you want to tweak these settings before proceeding? (y/N)
接着会问你是否需要改变配置,输入n,在弹出的页面修改机器的配置
然后点击保存,回到命令行窗口,等待编译结束,会问你,是否分配ip地址,输入n,不分配,后面我们手动分配共享ip
? Would you like to allocate dedicated ipv4 and ipv6 addresses now? (y/N)
接着等待一段时间,出现以下信息即表示部署完成。此时会部署两台机器,没有分配ip,接下来我们要分配ip
This deployment will:
* create 2 "app" machines
No machines in group app, launching a new machine
Creating a second machine to increase service availability
Finished launching new machines
-------
NOTE: The machines for [app] have services with 'auto_stop_machines = true' that will be stopped when idling
-------
Visit your newly deployed app at https://yk-x2ray.fly.dev/
记住这个Visit your newly deployed app at https://yk-x2ray.fly.dev/ 这个地址,后面要用到
分配共享ip
执行以下命令即可分配共享ip,
fly ip allocate-v4 --shared
此时在浏览器输入上面的地址,出现以下页面表示部署成功
配置客户端
框框中的就是上面执行的应用访问域名,根据你自己的设置修改,
用户id设置为准备阶段第4步记录的用户id
其他配置照抄即可。
使用效果
以下是访问youtube的速率可以到1.4M