TlsClientWrapper
A wrapper for bogdanfinn/tls-client
based on ffi-rs for unparalleled performance and usability. Inspired by @dryft/tlsclient
.
Installation
With npm:
npm install tlsclientwrapper
Information
This module, compared to bogdanfinn's example, offers:
- Updated JSDocs for faster coding.
- Use of the more updated ffi-rs.
- Automatic conversations, session support, etc.
- Default settings compatible with bogdafinn's client.
- Many more enhancements!
Usage
Simple Get Request:
import tlsClient from 'tlsclientwrapper';
const client = new tlsClient();
console.log(await client.get("https://example.com/"));
import tlsClient from 'tlsclientwrapper';
const client = new tlsClient({
defaultHeaders: {
"Custom-Header": "Custom-Value",
"User-Agent": "TlsClient/1.0"
},
defaultCookies: [
{
domain: "example.com",
expires: 0,
name: "testCookie",
path: "/",
value: "testValue"
}
]
});
console.log(await client.get("https://myhttpheader.com/"));
TLS Request
Don't worry, all requests by default are sent imitating chrome_120 TLS
import tlsClient from 'tlsclientwrapper';
const client = new tlsClient({
tlsClientIdentifier: "chrome_120"
});
console.log(await client.get("https://tls.peet.ws/api/all"));
For more Identifiers, check here: https://bogdanfinn.gitbook.io/open-source-oasis/tls-client/supported-and-tested-client-profiles
⚠️ Warning ⚠️
All the JSDocs are currently based on the TLSClient Version 1.7.2, if you're using a custom LibraryPath it will not update the JSDocs.
Constructor Options
Additional options for overriding defaults
TlsClientReponse
Additional Information
For more Documentation, please check https://bogdanfinn.gitbook.io/open-source-oasis
Special thanks to @bogdanfinn and @heydryft which both did great work and helped me build this wrapper.