mirror of
https://github.com/amnezia-vpn/amnezia-libxray.git
synced 2026-05-17 06:55:44 +03:00
add allowInsecure support
This commit is contained in:
@@ -10,6 +10,7 @@ import (
|
||||
"strings"
|
||||
)
|
||||
|
||||
// https://github.com/XTLS/Xray-core/discussions/716
|
||||
// Convert share text to XrayJson
|
||||
// support XrayJson, v2rayN plain text, v2rayN base64 text, Clash yaml, Clash.Meta yaml
|
||||
func ConvertShareTextToXrayJson(textPath string, xrayPath string) string {
|
||||
@@ -488,6 +489,17 @@ func (proxy xrayShareLink) parseSecurity(link *url.URL, streamSettings *XrayStre
|
||||
tlsSettings.Alpn = strings.Split(alpn, ",")
|
||||
}
|
||||
|
||||
// https://github.com/XTLS/Xray-core/discussions/716
|
||||
// 4.4.3 allowInsecure
|
||||
// 没有这个字段。不安全的节点,不适合分享。
|
||||
// I don't like this field, but too many people ask for it.
|
||||
allowInsecure := query.Get("allowInsecure")
|
||||
if len(allowInsecure) > 0 {
|
||||
if allowInsecure == "true" || allowInsecure == "1" {
|
||||
tlsSettings.AllowInsecure = true
|
||||
}
|
||||
}
|
||||
|
||||
pbk := query.Get("pbk")
|
||||
realitySettings.PublicKey = pbk
|
||||
sid := query.Get("sid")
|
||||
|
||||
@@ -323,6 +323,14 @@ func (proxy XrayOutbound) streamSettingsQuery(link *url.URL) {
|
||||
if len(alpn) > 0 {
|
||||
query = addQuery(query, "alpn", strings.Join(alpn, ","))
|
||||
}
|
||||
// https://github.com/XTLS/Xray-core/discussions/716
|
||||
// 4.4.3 allowInsecure
|
||||
// 没有这个字段。不安全的节点,不适合分享。
|
||||
// I don't like this field, but too many people ask for it.
|
||||
allowInsecure := streamSettings.TlsSettings.AllowInsecure
|
||||
if allowInsecure {
|
||||
query = addQuery(query, "allowInsecure", "1")
|
||||
}
|
||||
case "reality":
|
||||
if streamSettings.RealitySettings == nil {
|
||||
break
|
||||
|
||||
@@ -7,6 +7,7 @@ import (
|
||||
"strings"
|
||||
)
|
||||
|
||||
// https://github.com/2dust/v2rayN/wiki/%E5%88%86%E4%BA%AB%E9%93%BE%E6%8E%A5%E6%A0%BC%E5%BC%8F%E8%AF%B4%E6%98%8E(ver-2)
|
||||
type vmessQrCode struct {
|
||||
Ps string `json:"ps,omitempty"`
|
||||
Add string `json:"add,omitempty"`
|
||||
|
||||
Reference in New Issue
Block a user