Fixed QX tls issue

This commit is contained in:
Peng-YM 2022-06-19 01:14:38 +08:00
parent 340e3746fe
commit 83504d42c4
6 changed files with 25 additions and 13 deletions

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
import { OpenAPI } from '../vendor/open-api';
import { OpenAPI } from '@/vendor/open-api';
const $ = new OpenAPI('sub-store');
export default $;

View File

@ -1,10 +1,10 @@
import download from '../../utils/download';
import download from '@/utils/download';
import PROXY_PROCESSORS, { ApplyProcessor } from './processors';
import PROXY_PREPROCESSORS from './preprocessors';
import PROXY_PRODUCERS from './producers';
import PROXY_PARSERS from './parsers';
import $ from '../app';
import $ from '@/core/app';
function preprocess(raw) {
for (const processor of PROXY_PREPROCESSORS) {

View File

@ -142,6 +142,9 @@ function trojan(proxy) {
}
// tls
if (needTls(proxy)) {
proxy.tls = true;
}
appendIfPresent(`,over-tls=${proxy.tls}`, 'tls');
// tls fingerprint
@ -249,6 +252,9 @@ function http(proxy) {
appendIfPresent(`,password=${proxy.password}`, 'password');
// tls
if (needTls(proxy)) {
proxy.tls = true;
}
appendIfPresent(`,over-tls=${proxy.tls}`, 'tls');
// tls fingerprint
@ -286,6 +292,9 @@ function socks5(proxy) {
appendIfPresent(`,password=${proxy.password}`, 'password');
// tls
if (needTls(proxy)) {
proxy.tls = true;
}
appendIfPresent(`,over-tls=${proxy.tls}`, 'tls');
// tls fingerprint
@ -312,3 +321,12 @@ function socks5(proxy) {
return result.toString();
}
function needTls(proxy) {
return (
proxy.tls ||
proxy.sni ||
typeof proxy['skip-cert-verify'] !== 'undefined' ||
typeof proxy['tls-host'] !== 'undefined'
);
}

View File

@ -107,12 +107,6 @@ function vmess(proxy) {
result.append(`${proxy.name}=${proxy.type},${proxy.server},${proxy.port}`);
result.appendIfPresent(`,username=${proxy.uuid}`, 'uuid');
// if (proxy.cipher === 'auto') {
// result.append(`,encrypt-method=none`);
// } else {
// result.append(`,encrypt-method=${proxy.cipher}`);
// }
if (isPresent(proxy, 'network')) {
if (proxy.network === 'ws') {
result.append(`,ws=true`);

File diff suppressed because one or more lines are too long