Skip to content
Snippets Groups Projects
Commit 7b7ee554 authored by Kr328's avatar Kr328
Browse files

Feature: add option to enable sni sniff

parent eb7cd892
No related branches found
No related tags found
No related merge requests found
......@@ -23,7 +23,6 @@ var processors = []processor{
patchDns,
patchProviders,
patchTun,
patchSniff,
validConfig,
}
......@@ -106,5 +105,7 @@ func process(cfg *config.RawConfig, profileDir string) error {
}
}
log.Debugln("sni-tls: %t", cfg.Experimental.SniffTLSSNI)
return nil
}
......@@ -7,7 +7,3 @@ import "github.com/Dreamacro/clash/config"
func patchTun(cfg *config.RawConfig, _ string) error {
return nil
}
func patchSniff(cfg *config.RawConfig, _ string) error {
return nil
}
......@@ -9,9 +9,3 @@ func patchTun(cfg *config.RawConfig, _ string) error {
return nil
}
func patchSniff(cfg *config.RawConfig, _ string) error {
cfg.Experimental.SniffTLSSNI = true
return nil
}
\ No newline at end of file
......@@ -49,6 +49,9 @@ data class ConfigurationOverride(
@SerialName("clash-for-android")
val app: App = App(),
@SerialName("experimental")
val experimental: Experimental = Experimental()
) : Parcelable {
@Serializable
data class Dns(
......@@ -107,6 +110,12 @@ data class ConfigurationOverride(
var appendSystemDns: Boolean? = null
)
@Serializable
data class Experimental(
@SerialName("sniff-tls-sni")
var sniffTLSSNI: Boolean? = null,
)
@Serializable
enum class DnsEnhancedMode {
@SerialName("normal")
......
......@@ -223,6 +223,15 @@ class OverrideSettingsDesign(
)
}
if (BuildConfig.PREMIUM) {
selectableList(
value = configuration.experimental::sniffTLSSNI,
values = booleanValues,
valuesText = booleanValuesText,
title = R.string.sniff_tls_sni,
)
}
selectableList(
value = configuration::logLevel,
values = arrayOf(
......
......@@ -216,4 +216,5 @@
<string name="geoip_fallback_code">GeoIP Fallback 区域代码</string>
<string name="allow_bypass">允许应用绕过</string>
<string name="allow_bypass_summary">允许其他应用绕过 VPN</string>
<string name="sniff_tls_sni">嗅探 TLS 的 SNI</string>
</resources>
\ No newline at end of file
......@@ -145,6 +145,7 @@
<string name="bind_address">Bind Address</string>
<string name="mode">Mode</string>
<string name="log_level">Log Level</string>
<string name="sniff_tls_sni">Sniff TLS SNI</string>
<string name="ipv6">IPv6</string>
<string name="hosts">Hosts</string>
<string name="sideload_geoip">Sideload GEOIP</string>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment