feat: Surge 输出会判断 HTTP 是否 headers 字段

This commit is contained in:
xream 2025-03-01 21:43:14 +08:00
parent ebc7173c95
commit 9426f128c4
No known key found for this signature in database
GPG Key ID: 1D2C5225471789F9
2 changed files with 4 additions and 1 deletions

View File

@ -1,6 +1,6 @@
{
"name": "sub-store",
"version": "2.16.62",
"version": "2.16.63",
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and Shadowrocket.",
"main": "src/main.js",
"scripts": {

View File

@ -433,6 +433,9 @@ function ssh(proxy) {
return result.toString();
}
function http(proxy) {
if (proxy.headers && Object.keys(proxy.headers).length > 0) {
throw new Error(`headers is unsupported`);
}
const result = new Result(proxy);
const type = proxy.tls ? 'https' : 'http';
result.append(`${proxy.name}=${type},${proxy.server},${proxy.port}`);