Add covert-dtls to proxy and client with flags

This commit is contained in:
theodorsm 2024-11-30 22:17:27 +01:00
parent ae5bd52821
commit 541e124194
8 changed files with 88 additions and 16 deletions

View file

@ -174,6 +174,8 @@ func main() {
max := flag.Int("max", DefaultSnowflakeCapacity,
"capacity for number of multiplexed WebRTC peers")
versionFlag := flag.Bool("version", false, "display version info to stderr and quit")
dtlsRandomize := flag.Bool("dtls-randomize", false, "randomize DTLS client hello")
dtlsMimic := flag.Bool("dtls-mimic", false, "mimic DTLS client hello of Chrome and Firefox")
// Deprecated
oldLogToStateDir := flag.Bool("logToStateDir", false, "use -log-to-state-dir instead")
@ -186,6 +188,10 @@ func main() {
os.Exit(0)
}
if *dtlsMimic && *dtlsRandomize {
log.Fatal("Cannot both Randomize and Mimic DTLS client hello")
}
log.SetFlags(log.LstdFlags | log.LUTC)
// Don't write to stderr; versions of tor earlier than about 0.3.5.6 do
@ -240,6 +246,8 @@ func main() {
ICEAddresses: iceAddresses,
KeepLocalAddresses: *keepLocalAddresses || *oldKeepLocalAddresses,
Max: *max,
DTLSRandomize: *dtlsRandomize,
DTLSMimic: *dtlsMimic,
}
// Begin goptlib client process.