Skip to content

Commit

Permalink
Sync from Sub-Store v2.14.403
Browse files Browse the repository at this point in the history
  • Loading branch information
Ayideyia committed Oct 27, 2024
1 parent 574898f commit e673555
Showing 1 changed file with 7 additions and 14 deletions.
21 changes: 7 additions & 14 deletions plugins/Generic/plugin-node-convert.js
Original file line number Diff line number Diff line change
Expand Up @@ -557,12 +557,6 @@ function URI_VMess() {
} else {
delete proxy.network
}

// https://github.com/MetaCubeX/Clash.Meta/blob/Alpha/docs/config.yaml#L413
// sni 优先级应高于 host
if (proxy.tls && !proxy.sni && transportHost) {
proxy.sni = transportHost
}
}
return proxy
}
Expand Down Expand Up @@ -697,14 +691,13 @@ function URI_VLESS() {
if (Object.keys(opts).length > 0) {
proxy[`${proxy.network}-opts`] = opts
}
}

if (proxy.tls && !proxy.sni) {
if (proxy.network === 'ws') {
proxy.sni = proxy['ws-opts']?.headers?.Host
} else if (proxy.network === 'http') {
let httpHost = proxy['http-opts']?.headers?.Host
proxy.sni = Array.isArray(httpHost) ? httpHost[0] : httpHost
if (proxy.network === 'kcp') {
// mKCP 种子。省略时不使用种子,但不可以为空字符串。建议 mKCP 用户使用 seed。
if (params.seed) {
proxy.seed = params.seed
}
// mKCP 的伪装头部类型。当前可选值有 none / srtp / utp / wechat-video / dtls / wireguard。省略时默认值为 none,即不使用伪装头部,但不可以为空字符串。
proxy.headerType = params.headerType || 'none'
}
}

Expand Down

0 comments on commit e673555

Please sign in to comment.