diff --git a/examples/vlesss.client.toml b/examples/vlesss.client.toml index 5955d84..3afb815 100644 --- a/examples/vlesss.client.toml +++ b/examples/vlesss.client.toml @@ -99,6 +99,14 @@ utls = true #是否使用 utls 来应用 chrome指纹进行伪装, 仅用于 # advancedLayer = "ws" # 也可为 grpc 或 quic # path = "/ohmygod_verysimple_is_very_simple" # ws的path和 grpc的serviceName 都在这个path里填写, 为了防探测这里越长越随机越好 + +# 据说下面三行配置可以增强防御 + +# extra.tls_minVersion = "1.2" +# extra.tls_maxVersion = "1.2" +# extra.tls_cipherSuites = [ "TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256", "TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256"] + + [[dial]] tag = "mydirect" protocol = "direct" # direct 这个dial 是不需要特地写出的, 程序会自动创建一个 tag 为 "direct" 的 direct 的 dial. 不过如果是需要控制一下fullcone 的话, 此时就要写出来,因为程序默认的 direct 是不开启 fullcone的。 diff --git a/examples/vlesss.server.toml b/examples/vlesss.server.toml index 0674360..8ec2e3e 100644 --- a/examples/vlesss.server.toml +++ b/examples/vlesss.server.toml @@ -31,10 +31,15 @@ key = "cert.key" # 如果 cert和key中 有一项没给出, 或者文件不 #lazy = true -# extra = { tls_minVersion = "1.2" } # 默认的 minVersion 是1.3,你还可以设成1.2,其它值无效。 - # fullcone = true # 只有当listen和dial在 client和server配置 均为 fullcone时, 才会真正fullcone生效 +# 据说下面三行配置可以增强防御 + +# extra.tls_minVersion = "1.2" # 默认的 minVersion 是1.3,你还可以设成1.2,其它值无效。 +# extra.tls_maxVersion = "1.2" +# extra.tls_cipherSuites = [ "TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256", "TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256"] # 加密套件,所有可能的值请参考 golang的官方文档 + + [[dial]] protocol = "direct" # fullcone = true # 默认的fullcone是关闭状态, 可以取消注释以打开. 不过vless v0的话没用,因为vless v0不支持fullcone。 v1或者trojan可以打开 该选项. diff --git a/proxy/tlsConfig.go b/proxy/tlsConfig.go index 2804958..b9f53a8 100644 --- a/proxy/tlsConfig.go +++ b/proxy/tlsConfig.go @@ -189,6 +189,19 @@ func getTlsCipherSuitesFromExtra(extra map[string]any) []uint16 { if len(v) > 0 { return v } + } else { + if things, ok := thing.([]any); ok { + var v []uint16 + for _, s := range things { + cs := tlsLayer.StrToCipherSuite(s.(string)) + if cs > 0 { + v = append(v, cs) + } + } + if len(v) > 0 { + return v + } + } } } }