impersonator is a fork of BouncyCastle-bctls and okhttp that is designed to impersonate TLS fingerprints.
impersonator can
impersonate browsers' TLS/JA3 and HTTP/2 fingerprints. If you are blocked by some
website for no obvious reason, you can give impersonator a try.
- Supports TLS/JA3/JA4 fingerprints impersonation.
- Supports HTTP/2 fingerprints impersonation.
TLS/JA3/JA4 fingerprints impersonation
<dependency>
<groupId>com.github.zhkl0228</groupId>
<artifactId>impersonator-bctls</artifactId>
<version>1.0.13</version>
</dependency>TLS/JA3/JA4 fingerprints and HTTP/2 fingerprints impersonation
<dependency>
<groupId>com.github.zhkl0228</groupId>
<artifactId>impersonator-okhttp</artifactId>
<version>1.0.13</version>
</dependency>ImpersonatorApi api = ImpersonatorFactory.ios();
SSLContext context = api.newSSLContext(null, null); // for TLS/JA3/JA4 fingerprints impersonation
OkHttpClientFactory factory = OkHttpClientFactory.create(api);
OkHttpClient client = factory.newHttpClient(); // for TLS/JA3/JA4 fingerprints and HTTP/2 fingerprints impersonation// Single hostname → single IP
Dns dns = StaticDns.of("example.com", "1.2.3.4");
// Multiple hostnames or multiple IPs per hostname
Dns dns = new StaticDns.Builder()
.addHost("example.com", "1.2.3.4")
.addHost("api.example.com", "10.0.0.1", "10.0.0.2")
.build();
OkHttpClient client = factory.newHttpClient(dns);