Skip to content

Commit

Permalink
fix: surge tfo 参数缺失
Browse files Browse the repository at this point in the history
  • Loading branch information
geekdada committed Nov 2, 2019
1 parent 479e58f commit 47f4293
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ export const getSurgeNodes = (
config.method,
config.password,
'https://raw.githubusercontent.com/ConnersHua/SSEncrypt/master/SSEncrypt.module',
...pickAndFormatStringList(config, ['udp-relay', 'obfs', 'obfs-host']),
...pickAndFormatStringList(config, ['udp-relay', 'obfs', 'obfs-host', 'tfo']),
].join(', ')
].join(' = '));
}
Expand Down
1 change: 1 addition & 0 deletions test/fixture/plain/provider/custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ module.exports = {
'udp-relay': 'true',
obfs: 'tls',
'obfs-host': 'gateway-carry.icloud.com',
tfo: true,
},
{
type: 'snell',
Expand Down
2 changes: 1 addition & 1 deletion test/fixture/plain/surgio.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ module.exports = {
name: 'template-functions.conf',
template: 'template-functions',
provider: 'ss',
combineProviders: ['ss_json', 'v2rayn', 'clash'],
combineProviders: ['custom', 'ss_json', 'v2rayn', 'clash'],
},
],
urlBase: 'https://example.com/',
Expand Down
7 changes: 6 additions & 1 deletion test/snapshots/cli.test.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ Generated by [AVA](https://ava.li).
`🇺🇸US 1 = custom, us.example.com, 443, chacha20-ietf-poly1305, password, https://raw.githubusercontent.com/ConnersHua/SSEncrypt/master/SSEncrypt.module, obfs=tls, obfs-host=gateway-carry.icloud.com␊
🇺🇸US 2 = custom, us.example.com, 443, chacha20-ietf-poly1305, password, https://raw.githubusercontent.com/ConnersHua/SSEncrypt/master/SSEncrypt.module␊
🇺🇲 US = custom, us.example.com, 443, chacha20-ietf-poly1305, password, https://raw.githubusercontent.com/ConnersHua/SSEncrypt/master/SSEncrypt.module, udp-relay=true, obfs=tls, obfs-host=gateway-carry.icloud.com, tfo=true␊
Snell = snell, us.example.com, 443, psk=password, obfs=tls␊
HTTPS = https, us.example.com, 443, username, password␊
🇺🇸US 1 = custom, us.example.com, 443, chacha20-ietf-poly1305, password, https://raw.githubusercontent.com/ConnersHua/SSEncrypt/master/SSEncrypt.module, obfs=tls, obfs-host=gateway-carry.icloud.com␊
🇺🇸US 2 = custom, us.example.com, 444, chacha20-ietf-poly1305, password, https://raw.githubusercontent.com/ConnersHua/SSEncrypt/master/SSEncrypt.module␊
🇺🇸US 3 = custom, us.example.com, 445, chacha20-ietf-poly1305, password, https://raw.githubusercontent.com/ConnersHua/SSEncrypt/master/SSEncrypt.module, obfs=tls, obfs-host=www.bing.com␊
Expand All @@ -20,10 +23,12 @@ Generated by [AVA](https://ava.li).
ss2 = custom, server, 443, chacha20-ietf-poly1305, password, https://raw.githubusercontent.com/ConnersHua/SSEncrypt/master/SSEncrypt.module, udp-relay=false, obfs=tls, obfs-host=www.bing.com␊
ss4 = custom, server, 443, chacha20-ietf-poly1305, password, https://raw.githubusercontent.com/ConnersHua/SSEncrypt/master/SSEncrypt.module, udp-relay=false, obfs=tls, obfs-host=example.com␊
----␊
🇺🇸US 1, 🇺🇸US 2, 🇺🇸US 1, 🇺🇸US 2, 🇺🇸US 3, 🇺🇸US 4, 测试 1, 测试 2, ss1, ss2, ss4␊
🇺🇸US 1, 🇺🇸US 2, 🇺🇲 US, Snell, HTTPS, 🇺🇸US 1, 🇺🇸US 2, 🇺🇸US 3, 🇺🇸US 4, 测试 1, 测试 2, ss1, ss2, ss4␊
----␊
shadowsocks=us.example.com:443, method=chacha20-ietf-poly1305, password=password, obfs=tls, obfs-host=gateway-carry.icloud.com, tag=🇺🇸US 1␊
shadowsocks=us.example.com:443, method=chacha20-ietf-poly1305, password=password, tag=🇺🇸US 2␊
shadowsocks=us.example.com:443, method=chacha20-ietf-poly1305, password=password, obfs=tls, obfs-host=gateway-carry.icloud.com, udp-relay=true, fast-open=true, tag=🇺🇲 US␊
http=us.example.com:443, username=username, password=password, over-tls=true, tag=HTTPS␊
shadowsocks=us.example.com:443, method=chacha20-ietf-poly1305, password=password, obfs=tls, obfs-host=gateway-carry.icloud.com, tag=🇺🇸US 1␊
shadowsocks=us.example.com:444, method=chacha20-ietf-poly1305, password=password, tag=🇺🇸US 2␊
shadowsocks=us.example.com:445, method=chacha20-ietf-poly1305, password=password, obfs=tls, obfs-host=www.bing.com, tag=🇺🇸US 3␊
Expand Down
Binary file modified test/snapshots/cli.test.ts.snap
Binary file not shown.

0 comments on commit 47f4293

Please sign in to comment.