Skip to content

Commit

Permalink
fix: sni is missing in surge trojan config
Browse files Browse the repository at this point in the history
  • Loading branch information
geekdada committed Apr 5, 2020
1 parent 2d01be4 commit be0c340
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
7 changes: 1 addition & 6 deletions lib/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -414,12 +414,7 @@ export const getSurgeNodes = function(
nodeConfig.hostname,
`${nodeConfig.port}`,
`password=${nodeConfig.password}`,
...(typeof nodeConfig.tfo === 'boolean' ? [
`tfo=${nodeConfig.tfo}`,
] : []),
...(typeof nodeConfig.mptcp === 'boolean' ? [
`mptcp=${nodeConfig.mptcp}`,
] : []),
...pickAndFormatStringList(nodeConfig, ['tfo', 'mptcp', 'sni']),
...(typeof nodeConfig.skipCertVerify === 'boolean' ? [
`skip-cert-verify=${nodeConfig.skipCertVerify}`,
] : []),
Expand Down
3 changes: 2 additions & 1 deletion test/utils/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,11 +207,12 @@ test('getSurgeNodes', async t => {
hostname: 'example.com',
port: 443,
password: 'password1',
sni: 'sni.com',
tfo: true,
mptcp: true,
skipCertVerify: true,
}]),
'trojan node 2 = trojan, example.com, 443, password=password1, tfo=true, mptcp=true, skip-cert-verify=true',
'trojan node 2 = trojan, example.com, 443, password=password1, tfo=true, mptcp=true, sni=sni.com, skip-cert-verify=true',
);

t.is(
Expand Down

0 comments on commit be0c340

Please sign in to comment.