Skip to content

Commit

Permalink
Backend: apply custom initial HTTP2 SETTINGS frame to Chrome browser …
Browse files Browse the repository at this point in the history
…fingerprints (closes #11)
  • Loading branch information
sleeyax committed Jun 3, 2023
1 parent f2c9238 commit 68815dc
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src-go/server/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ require (
golang.org/x/text v0.9.0 // indirect
)

replace github.com/ooni/oohttp => github.com/sleeyax/oohttp v0.0.0-20230603093000-5878d39f799b
replace github.com/ooni/oohttp => github.com/sleeyax/oohttp v0.0.0-20230603105812-6ac0447b1a8e
4 changes: 2 additions & 2 deletions src-go/server/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ github.com/klauspost/compress v1.15.15 h1:EF27CXIuDsYJ6mmvtBRlEuB2UVOqHG1tAXgZ7y
github.com/klauspost/compress v1.15.15/go.mod h1:ZcK2JAFqKOpnBlxcLsJzYfrS9X1akm9fHZNnD9+Vo/4=
github.com/refraction-networking/utls v1.3.2 h1:o+AkWB57mkcoW36ET7uJ002CpBWHu0KPxi6vzxvPnv8=
github.com/refraction-networking/utls v1.3.2/go.mod h1:fmoaOww2bxzzEpIKOebIsnBvjQpqP7L2vcm/9KUfm/E=
github.com/sleeyax/oohttp v0.0.0-20230603093000-5878d39f799b h1:p8IFdGGVs/v7zW/rYB/A9jT1GFfjIbewbcN+KpcfCAs=
github.com/sleeyax/oohttp v0.0.0-20230603093000-5878d39f799b/go.mod h1:/7fPgmXNkMSXBpLOdARkhyn3vsNAtmZ0C3G5C/KLd6Q=
github.com/sleeyax/oohttp v0.0.0-20230603105812-6ac0447b1a8e h1:evx5O2TAZdPLDCqPuEI5yo4Sg3LT5cImPVbno6HKM2s=
github.com/sleeyax/oohttp v0.0.0-20230603105812-6ac0447b1a8e/go.mod h1:/7fPgmXNkMSXBpLOdARkhyn3vsNAtmZ0C3G5C/KLd6Q=
golang.org/x/crypto v0.5.0 h1:U/0M97KRkSFvyD/3FSmdP5W5swImpNgle/EHFhOsQPE=
golang.org/x/crypto v0.5.0/go.mod h1:NK/OQwhpMQP3MwtdjgLlYHnH9ebylxKWv3e0fK+mkQU=
golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M=
Expand Down
11 changes: 11 additions & 0 deletions src-go/server/internal/transport.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,17 @@ func NewTransport(config *TransportConfig) *oohttp.StdlibTransport {
TLSClientFactory: tlsFactory.NewUTLSConn,
}

// add realistic initial HTTP2 SETTINGS to Chrome browser fingerprints
if strings.HasPrefix(string(config.Fingerprint), "Chrome") {
transport.EnableCustomInitialSettings()
transport.HeaderTableSize = 65536
transport.EnablePush = 0
transport.MaxConcurrentStreams = 1000
transport.InitialWindowSize = 6291456
transport.MaxFrameSize = 16384
transport.MaxHeaderListSize = 262144
}

if config.IdleConnTimeout != 0 {
transport.IdleConnTimeout = time.Duration(config.IdleConnTimeout) * time.Second
}
Expand Down

0 comments on commit 68815dc

Please sign in to comment.