Skip to content

Commit

Permalink
🐛 Fix vless parser cannot correctly parse some reality/grpc fields
Browse files Browse the repository at this point in the history
  • Loading branch information
nitezs committed May 5, 2024
1 parent 25e4745 commit b73a02b
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 21 deletions.
42 changes: 22 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,31 @@
# sub2clash

> Sing-box 用户?看看另一个项目 [sub2sing-box](https://github.com/nitezs/sub2sing-box)
将订阅链接转换为 Clash、Clash.Meta 配置
[预览](https://www.nite07.com/sub)

## 特性

- 开箱即用的规则、策略组配置
- 自动根据节点名称按国家划分策略组
- 支持多订阅合并
- 支持添加自定义 Rule Provider、Rule
- 支持多种协议
- Shadowsocks
- ShadowsocksR
- Vmess
- Vless (Clash.Meta)
- Trojan
- Hysteria (Clash.Meta)
- Hysteria2 (Clash.Meta)
- 开箱即用的规则、策略组配置
- 自动根据节点名称按国家划分策略组
- 多订阅合并
- 自定义 Rule Provider、Rule
- 支持多种协议
- Shadowsocks
- ShadowsocksR
- Vmess
- Vless (Clash.Meta)
- Trojan
- Hysteria (Clash.Meta)
- Hysteria2 (Clash.Meta)

## 使用

### 运行
### 部署

- [docker compose](./docker-compose.yml)
- 运行[二进制文件](https://github.com/nitezs/sub2clash/releases/latest)
- [docker compose](./docker-compose.yml)
- 运行[二进制文件](https://github.com/nitezs/sub2clash/releases/latest)

### 配置

Expand All @@ -49,11 +51,11 @@
可以通过变量自定义模板中的策略组代理节点
具体参考下方默认模板

- `<all>` 为添加所有节点
- `<countries>` 为添加所有国家策略组
- `<地区二位字母代码>` 为添加指定地区所有节点,例如 `<hk>` 将添加所有香港节点
- `<all>` 为添加所有节点
- `<countries>` 为添加所有国家策略组
- `<地区二位字母代码>` 为添加指定地区所有节点,例如 `<hk>` 将添加所有香港节点

#### 默认模板

- [Clash](./templates/template_clash.yaml)
- [Clash.Meta](./templates/template_meta.yaml)
- [Clash](./templates/template_clash.yaml)
- [Clash.Meta](./templates/template_meta.yaml)
5 changes: 4 additions & 1 deletion parser/vless.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ func ParseVless(proxy string) (model.Proxy, error) {

if security == "reality" {
result.TLS = true
result.Servername = sni
result.RealityOpts = model.RealityOptions{
PublicKey: pbk,
ShortID: sid,
Expand All @@ -133,7 +134,9 @@ func ParseVless(proxy string) (model.Proxy, error) {

if _type == "grpc" {
result.Network = "grpc"
result.Servername = serviceName
result.GrpcOpts = model.GrpcOptions{
GrpcServiceName: serviceName,
}
}

if _type == "http" {
Expand Down

0 comments on commit b73a02b

Please sign in to comment.