要配置加速器订阅文件,通常需要将订阅规则存储在一个特定的文件夹中,通常命名为 substitutions 或 configures,文件名可能是 substitutions.json 或 configures.json,格式使用 JSON。
创建订阅规则文件夹
创建一个文件夹或路径,用于存储订阅规则。
substitutions/
添加订阅规则
在文件夹中创建一个 JSON 文件,存储订阅规则。
{
"substitutions": [
{
"url": "http://localhost:88",
"method": "GET",
"access_type": "read"
},
{
"url": "http://localhost:881",
"method": "POST",
"access_type": "read"
},
{
"url": "https://example.com/our-server",
"method": "GET",
"access_type": "read-only"
}
]
}
添加订阅规则到文件中
将上述规则添加到 substitutions.json 文件中。
{
"substitutions": [
{
"url": "http://localhost:88",
"method": "GET",
"access_type": "read"
},
{
"url": "http://localhost:881",
"method": "POST",
"access_type": "read"
},
{
"url": "https://example.com/our-server",
"method": "GET",
"access_type": "read-only"
}
]
}
添加请求来源和方法
在每个订阅条目中,包含请求来源和请求方法:
{
"substitutions": [
{
"source": "example.com",
"method": "GET"
},
{
"source": "localhost:881",
"method": "POST"
},
{
"source": "https://example.com/our-server",
"method": "GET"
}
]
}
测试订阅规则
将 substitutions.json 文件添加到服务器的允许访问列表中,并运行测试,确保订阅规则能够正确访问指定的资源。
注意事项
- 确保你的服务器允许访问这些资源。
- 确保你的订阅规则与你的访问权限兼容。
- 如果使用其他协议(如 HTTPS),确保你的订阅规则支持这些协议。
示例文件
以下是一个示例的 substitutions.json 文件:
{
"substitutions": [
{
"url": "http://localhost:88",
"method": "GET",
"access_type": "read"
},
{
"url": "http://localhost:881",
"method": "POST",
"access_type": "read"
},
{
"url": "https://example.com/our-server",
"method": "GET",
"access_type": "read-only"
}
]
}



