Skip to content

Commit

Permalink
feat: add support for quantumultx tls1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
geekdada committed Apr 7, 2020
1 parent 7955c42 commit 007db56
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ export interface ShadowsocksNodeConfig extends SimpleNodeConfig {
readonly 'obfs-uri'?: string;
readonly skipCertVerify?: boolean;
readonly wsHeaders?: Record<string, string>;
readonly tls13?: boolean;
}

export interface SnellNodeConfig extends SimpleNodeConfig {
Expand Down Expand Up @@ -216,6 +217,7 @@ export interface TrojanNodeConfig extends SimpleNodeConfig {
readonly alpn?: ReadonlyArray<string>;
readonly sni?: string;
readonly 'udp-relay'?: boolean;
readonly tls13?: boolean;
}

export interface Socks5NodeConfig extends SimpleNodeConfig {
Expand Down
15 changes: 15 additions & 0 deletions lib/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -920,6 +920,9 @@ export const getQuantumultXNodes = function(
}
config.push(`obfs-uri=${nodeConfig.path || '/'}`);
config.push(`obfs-host=${nodeConfig.host || nodeConfig.hostname}`);
if (nodeConfig.tls13) {
config.push(`tls13=true`);
}

break;
case 'tcp':
Expand Down Expand Up @@ -961,6 +964,9 @@ export const getQuantumultXNodes = function(
...(nodeConfig.tfo ? [
`fast-open=${nodeConfig.tfo}`,
] : []),
...(nodeConfig.tls13 ? [
`tls13=${nodeConfig.tls13}`,
] : []),
`tag=${nodeConfig.nodeName}`,
]
.join(', ');
Expand Down Expand Up @@ -1008,6 +1014,9 @@ export const getQuantumultXNodes = function(
config.push(
'over-tls=true',
`tls-verification=${nodeConfig.skipCertVerify !== true}`,
...(nodeConfig.tls13 ? [
`tls13=${nodeConfig.tls13}`,
] : []),
);
}

Expand All @@ -1022,12 +1031,18 @@ export const getQuantumultXNodes = function(
...pickAndFormatStringList(nodeConfig, ['password']),
'over-tls=true',
`tls-verification=${nodeConfig.skipCertVerify !== true}`,
...(nodeConfig.sni ? [
`tls-host=${nodeConfig.sni}`,
] : []),
...(nodeConfig.tfo ? [
`fast-open=${nodeConfig.tfo}`,
] : []),
...(nodeConfig['udp-relay'] ? [
`udp-relay=${nodeConfig['udp-relay']}`,
] : []),
...(nodeConfig.tls13 ? [
`tls13=${nodeConfig.tls13}`,
] : []),
`tag=${nodeConfig.nodeName}`,
];

Expand Down

0 comments on commit 007db56

Please sign in to comment.