You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+33-3Lines changed: 33 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -58,7 +58,7 @@ GREASE values are preserved (they're what the client actually sent). The `calcul
58
58
59
59
Extensions with registered parsers return structured data. Flag extensions (like `extended_master_secret` or `signed_certificate_timestamp`) return `{}`. Unrecognized, unparseable or GREASE extensions return `null`. If an extension parser encounters malformed data, it falls back to `null` rather than failing the entire parse.
@@ -69,9 +69,35 @@ To calculate TLS fingerprints, there are a few options exported from this module
69
69
*`calculateJa3(clientHello)` - Takes a parsed `TlsClientHelloMessage` and returns the corresponding JA3 hash.
70
70
*`calculateJa4(clientHello)` - Takes a parsed `TlsClientHelloMessage` and returns the corresponding JA4 hash.
71
71
72
+
### Accessing extension data
73
+
74
+
Use `getExtensionData(extensions, id)` to look up a specific extension's parsed data by numeric ID, name, or alias. Returns the data object, or `null` if the extension is not present.
75
+
76
+
Names should be the officially registered name from https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml. Convenient aliases are provided for common cases, including `sni`, `alpn`, `alps` and `ech`. The API is typed so with TypeScript only valid names are allowed (although any raw numeric id can be used). PRs to add more aliases are welcome.
constversions= svData?.versions; // e.g. [0x0304, 0x0303]
94
+
```
95
+
72
96
### Lookup tables
73
97
74
-
All hello details (extensions, ciphers, etc) are exposed in `clientHello` with only numeric ids. To get human-readable names, lookup tables are provided:
98
+
All hello details (extensions, ciphers, etc) are exposed with numeric IDs. Lookup tables map these to human-readable names. All tables are fully typed with `as const`, soknownkeysreturnliteralvalues, whichotherkeys' valuesmaybeundefined.
0 commit comments