主要用于nas和docker容器科学上网
1.安装
docker compose
前置工作(以qnapContainer Station为例):
- Container共享文件夹下新建clash文件夹
1 2 3 4 5 6 7 8 9
| services: alist: image: 'dreamacro/clash' container_name: clash volumes: - '/share/Container/clash:/root/.config/clash' ports: - '7890:7890' restart: unless-stopped
|
2.配置
2.1 获取配置文件
dns、proxies、proxy-groups、rules根据自己的订阅或节点修改
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| ipv6: true mixed-port: 7890 udp: true allow-lan: true bind-address: '*' mode: rule log-level: info external-controller: '127.0.0.1:9090' unified-delay: true secret: '' experimental: ignore-resolve-fail: true cfw-latency-timeout: 8000 cfw-latency-url: 'https://www.gstatic.com/generate_204' cfw-conn-break-strategy: true dns: proxies: proxy-groups: rules:
|
2.2 替换配置文件
将上述文件保存config.yaml,替换/share/Container/clash中的同名配置文件;若没有则新增