Coder Social home page Coder Social logo

lunarfang416 / tlsclient.js Goto Github PK

View Code? Open in Web Editor NEW

This project forked from heydryft/tlsclient.js

0.0 0.0 0.0 51 KB

An axios based wrapper for bogdanfinn/tls-client based on ffi-rs for unparalleled performance and usability.

JavaScript 32.16% TypeScript 67.84%

tlsclient.js's Introduction

tlsclient.js

An axios based wrapper for bogdanfinn/tls-client based on ffi-rs for unparalleled performance and usability.

Performance

perf

Installation

Install with npm

  npm i @dryft/tlsclient

Usage

First run:

import { createTLSClient } from "@dryft/tlsclient";

const axios = createTLSClient();
let res = await axios.get("https://ipv4.icanhazip.com");

Definition

**
 * Create a TLS client.
 * Extra/Modified options available in config (can be also used per request (except tlsLibPath)) are:
 * - `proxy` - The proxy to use. (http://user:pass@host:port)
 * - `tlsClientIdentifier` - Choose the desired tls client. (https://github.com/bogdanfinn/tls-client/blob/master/profiles/profiles.go#L10)
 * - `customTlsClient` - Use a custom tls client instead of the default one. (https://github.com/bogdanfinn/tls-client/blob/master/cffi_dist/example_node/index_custom_client.js#L27)
 * - `tlsLibPath` - Specify path for a bogdanfinn/tls-client fork (.dll, .dylib, .so) (optional).
 * - `forceHttp1` - Force http1.
 * - `followRedirects` - Follow redirects.
 * - `insecureSkipVerify` - Skip tls certificate verification.
 * - `withRandomTLSExtensionOrder` - Randomize the order of tls extensions.
 * - `timeout` - Request timeout.
 * - `defaultHeaders` - Default headers to use. Usually the browser default headers.
 * - `headerOrder` - The order of the headers.
 * @param {TLSClientConfiguration} config The configuration.
 *
 * @returns {AxiosInstance} The TLS client.
 */
export function createTLSClient(config) {
  let adapter = createAdapter(config);
  return axios.create({
    adapter,
    ...config,
  });
}

tlsclient.js's People

Contributors

heydryft avatar stealthninja1o1 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.