惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

F
Fortinet All Blogs
爱范儿
爱范儿
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
B
Blog
WordPress大学
WordPress大学
Jina AI
Jina AI
GbyAI
GbyAI
aimingoo的专栏
aimingoo的专栏
N
Netflix TechBlog - Medium
腾讯CDC
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
阮一峰的网络日志
阮一峰的网络日志
The GitHub Blog
The GitHub Blog
V
Visual Studio Blog
Google DeepMind News
Google DeepMind News
月光博客
月光博客
博客园 - Franky
Y
Y Combinator Blog
MyScale Blog
MyScale Blog
大猫的无限游戏
大猫的无限游戏
Martin Fowler
Martin Fowler
雷峰网
雷峰网
小众软件
小众软件
H
Hackread – Cybersecurity News, Data Breaches, AI and More

繁星点点

最新轻量级龙虾部署教程 通过netboot.xyz重装系统 giffgaff卡保号教程 Llinux系统中全新透明代理方案(可代理所有出站流量) tailscale开启子网路由常见的坑 OpenWrt固件编译 解决UFW和Docker的问题 使用PGP的非对称算法加密文件 NSSM工具把任意exe程序注册为Windows后台服务 轻量级简约端口转发rinetd 安卓IDE的安装和使用 IP信息查询网站汇总 热点共享代理教程 SSH使用密钥认证登录详细解释 Debian系统公网IP出口切换指南,适用多IP服务器 Windows系统安装Scoop包管理器 安卓Flutter开发学习笔记 使用手机搭建节点服务端 关于github提交记录泄露真实邮箱的处理办法 caddy给域名用上ECH加密 通过gitlab流水线自动备份仓库 通过CF-Workers代理访问网站 低配机器使用alpine系统跑docker 端口敲门教程 3x-ui面板通过api管理示例 nmap端口扫描 数据库常用命令 snap和winget包管理器 Git推送GitHub常用命令 😩😩😩学不完,根本学不完😩😩😩
anytls协议部署教程
2025-05-12 · via 繁星点点

使用sing-box手搓anytls协议

  • 以下配置需要自行去掉注释

服务端(运行在服务器里)

curl -fsSL https://sing-box.app/install.sh | sh

配置路径:/etc/sing-box/config.json

自签证书:

openssl req -x509 -nodes -newkey ec:<(openssl ecparam -name prime256v1) \
-keyout /etc/sing-box/key.pem \
-out /etc/sing-box/cert.pem \
-subj "/CN=bing.com" \
-days 3650 && \
chmod 600 /etc/sing-box/key.pem && chmod 644 /etc/sing-box/cert.pem

服务端节点配置:

{
  "log": {
    "level": "info"
  },
  "inbounds": [
    {
      "type": "anytls",
      "tag": "anytls-in",
      "listen": "::",
      "listen_port": 8443, // 节点端口
      "users": [
        {
          "name": "sekai",  // 名称随意填写
          "password": "aHR0cHM6Ly9ibG9nLjUyMDEzMTIwLnh5ei8=" // 协议认证密码
        }
      ],
      "tls": {
        "enabled": true,
        "insecure": true, // 允许不安全
        "server_name": "bing.com", // 自签证书的域名
        "certificate_path": "/etc/sing-box/cert.pem",  // 自签证书公钥
        "key_path": "/etc/sing-box/key.pem" // 自签证书私钥
      }
    }
  ],
  "outbounds": [
    {
      "type": "direct",
      "tag": "direct-out"
    }
  ],
  "route": {
    "rules": []
  }
}

命令:

重启 systemctl restart sing-box

停止 systemctl stop sing-box

开启开机自启 systemctl enable sing-box

查看运行状态 systemctl status sing-box

查看日志 journalctl -u sing-box --output cat -e


客户端(运行在本地设备)

客户端配置示例:

config.json

{
  "log": {
    "level": "warn",
    "timestamp": true
  },
  "inbounds": [
    {
      "type": "mixed",
      "tag": "socks",
      "listen": "127.0.0.1", 
      "listen_port": 10808 // 本地入站端口
    }
  ],
  "outbounds": [
    {
      "type": "anytls",
      "tag": "anytls-out",
      "server": "9.9.9.9", // 服务端地址
      "server_port": 8443,  // 节点端口
      "password": "aHR0cHM6Ly9ibG9nLjUyMDEzMTIwLnh5ei8=",  // 协议认证密码
      "tls": {
        "enabled": true,
        "insecure": true, // 允许不安全
        "server_name": "bing.com"  // 自签证书域名
      }
    }
  ],
  "route": {
    "rules": [
      {
        "inbound": ["socks"],
        "outbound": "anytls-out"
      }
    ]
  }
}

客户端clash-verge配置文件

proxies:
- name: anytls节点
  type: anytls
  server: 9.9.9.9 # 服务端地址
  port: 8443 # 节点端口
  password: "aHR0cHM6Ly9ibG9nLjUyMDEzMTIwLnh5ei8=" # 协议认证密码
  idle-session-check-interval: 30
  idle-session-timeout: 30
  min-idle-session: 0
  tls: true
  skip-cert-verify: true
  servername: bing.com # 自签域名

1:订阅——新建——类型选Local——名称随便填——确认——右键编辑文件——替换以上全部文件

2:此时代理菜单里就可以看到该节点:

以上客户端配置为简化版本,更多分流信息可以自己研究下。安卓手机可以直接使用NekoBoxForAndroid,苹果使用小火箭。