FlClash 是一个基于 Node.js 的开源项目,主要用于构建云容器架构,支持多种容器类型(如 K8s、Vpc 和 Pod)以及不同的容器管理协议,以下是一些关于 FlClash 节点配置的常见步骤和示例:
安装 FlClash
在 Node.js 中安装 FlClash:
npm install --save-dev --skip-directories --save-dev-flclash
设置环境变量
FlClash 提供了一些常用的环境变量,可以用于配置:
FLASH_URL: 链接到 FlClash 的 URL。FLASH_PORT: 链接到 FlClash 的端口。FLASH_PORT_SSL: 链接到 SSL 端口(如果使用 SSL 案保)。
export FLASH_URL="https://flclash.example.com" export FLASH_PORT="88" export FLASH_PORT_SSL="88"
配置 K8s 容器
FlClash 通过 K8s 来构建容器,适用于小企业环境。
步骤 1:安装 K8s
确保 K8s 和 FlClash 已经安装在你的云环境中:
k8s prepare
步骤 2:配置容器
在 K8s 中配置 FlClash 容器:
# 启动 FlClash 容器 k8s start --config=/path/to/FlClash/config/FlClash.json # 可以停止容器 k8s stop # 可以进入容器 flclash
步骤 3:配置端口
在容器中,设置端口:
# 选择端口 port 88 # 设置端口类型 port set 88 type onPort # 设置端口权限 port set 88 onPort port set 88 onPort port set 88 onPort port set 88 onPort
配置 Vpc 容器
FlClash 也可以通过 Vpc 来构建容器,适用于企业级应用。
步骤 1:安装 Vpc
确保 Vpc 已经安装在你的云环境中:
vpc prepare
步骤 2:配置 Vpc 服务器
在 Vpc 服务器中配置 FlClash:
# 启动 Vpc vpc start # 启动 FlClash 容器 vpc start --config=/path/to/FlClash/config/FlClash.json # 可以停止容器 vpc stop
步骤 3:配置端口
在容器中,设置端口:
port 88 # 设置端口类型 port set 88 type onPort # 设置端口权限 port set 88 onPort port set 88 onPort port set 88 onPort port set 88 onPort
步骤 4:配置文件系统
在容器中,设置文件系统:
# 设置文件系统 file system local # 设置路径 path /path/to/flclash directory
配置 Pod 容器
FlClash 也可以通过 Pod 来构建容器,适用于小企业环境。
步骤 1:安装 Pod
确保 Pod 已经安装在你的云环境中:
pod prepare
步骤 2:配置容器
在 Pod 服务器中配置 FlClash:
# 启动 Pod pod start # 启动 FlClash 容器 pod start --config=/path/to/FlClash/config/FlClash.json # 可以停止容器 pod stop # 可以进入容器 flclash
步骤 3:配置端口
在容器中,设置端口:
port 88 # 设置端口类型 port set 88 type onPort # 设置端口权限 port set 88 onPort port set 88 onPort port set 88 onPort port set 88 onPort
步骤 4:配置访问权限
在容器中,指定访问权限:
access 1 # 将访问权限设置为 1 access set 1
管理容器列表
FlClash 提供一个容器列表,用户可以通过 API 或命令管理容器。
蓝色标记的容器列表
默认情况下,FlClash 会管理容器列表,你可以通过 API 或命令查看和管理容器。
检查容器列表
# 检查所有容器 list
注意事项
- FlClash 版本:确保 FlClash 的版本符合项目需求,常用版本包括 Vpc(基于 K8s)和 Pod(小企业容器)。
- 端口配置:端口配置必须与项目需求匹配,确保数据传输和访问权限正确。
- 权限管理:FlClash 提供 API 来管理访问权限,确保容器的访问控制正确。
通过以上步骤,你可以根据需要配置 FlClash,构建云容器架构。




