Merge pull request #82 from apernet/update-fet

feat: update FET analyzer to better reflect what's described in the paper
This commit is contained in:
Toby 2024-02-26 15:28:33 -08:00 committed by GitHub
commit 5d2d874089
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -143,8 +143,11 @@ func isTLSorHTTP(bytes []byte) bool {
if len(bytes) < 3 {
return false
}
if bytes[0] == 0x16 && bytes[1] == 0x03 && bytes[2] <= 0x03 {
// TLS handshake for TLS 1.0-1.3
// "We observe that the GFW exempts any connection whose first
// three bytes match the following regular expression:
// [\x16-\x17]\x03[\x00-\x09]" - from the paper in Section 4.3
if bytes[0] >= 0x16 && bytes[0] <= 0x17 &&
bytes[1] == 0x03 && bytes[2] <= 0x09 {
return true
}
// HTTP request