mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-14 14:11:23 -04:00
Add CovertDTLSConfig
This commit is contained in:
parent
5912e2892a
commit
bb11646e73
11 changed files with 89 additions and 56 deletions
24
common/covertdtls/covert_dtls_config.go
Normal file
24
common/covertdtls/covert_dtls_config.go
Normal file
|
@ -0,0 +1,24 @@
|
|||
package covertdtls
|
||||
|
||||
import (
|
||||
"github.com/theodorsm/covert-dtls/pkg/fingerprints"
|
||||
"strings"
|
||||
)
|
||||
|
||||
type CovertDTLSConfig struct {
|
||||
Randomize bool
|
||||
Mimic bool
|
||||
Fingerprint fingerprints.ClientHelloFingerprint
|
||||
}
|
||||
|
||||
func ParseConfigString(str string) CovertDTLSConfig {
|
||||
config := CovertDTLSConfig{}
|
||||
str = strings.ToLower(str)
|
||||
if strings.Contains(str, "random") {
|
||||
config.Randomize = true
|
||||
}
|
||||
if strings.Contains(str, "mimic") {
|
||||
config.Mimic = true
|
||||
}
|
||||
return config
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue