Giter Club home page Giter Club logo

tlsclient's Introduction

πŸ’« About Me:

Just a small Developer, coding in his free time :)

πŸ’» Tech Stack:

JavaScript Java HTML5 GithubPages Bootstrap Chart.js Express.js NodeJS Nodemon NPM Next JS TailwindCSS Nginx Apache MongoDB Canva

πŸ“Š GitHub Stats:




tlsclient's People

Contributors

demonmartin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

sa7cez

tlsclient's Issues

Crash during the launch of any request

I'm trying to run the code from the example, but the application crashes (without errors, just crash, last node logs message npm verb exit 3221226356)
Mb need to install some deps like any dll or go libs?
Running via node index.js

node ver: v20.11.0
os: win11 x64

index.js

import tlsClient from "tlsclientwrapper";
const client = new tlsClient();

console.log(await client.get("https://example.com/"));

package.json

{
  "name": "test",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "type": "module",
  "scripts": {
    "test": "node index.js"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "tlsclientwrapper": "^1.4.3"
  }
}

Error running file

Hi. im trying to run the first cmd on my pc:

import tlsClient from 'tlsclientwrapper';
const client = new tlsClient();

console.log(await client.get("https://example.com/"));

and getting:

let lib = load(...args);
^

Error: Failed to load shared library: The operation completed successfully.
at module.exports.load (C:\Users\a.Jones\Downloads\b2.0.1\a\node_modules\koffi\index.js:542:13)
at Client.open (file:///C:/Users/a.Jones/Downloads/b%202.0.1/a/node_modules/tlsclientwrapper/utils/client.js:62:26)
at async #init (file:///C:/Users/a.Jones/Downloads/b%202.0.1/a/node_modules/tlsclientwrapper/index.js:61:13)
at async #request (file:///C:/Users/a.Jones/Downloads/b%202.0.1/a/node_modules/tlsclientwrapper/index.js:183:9)

Node.js v18.7.0

param order possibly tampered by tls client?

hello
i've noticed that with stock axios the params / query strings are sent exactly as the URLSearchParams object gives, but that with tls client, it seems to:

  1. use its own param order
  2. remove duplicate param strings

here is the function i use for reordering search params

reorderSearchParams(searchParams, paramsOrder) {
  const orderedParams = new URLSearchParams();
  const allKeys = Array.from(searchParams.keys());
  const keySet = new Set(allKeys);
  // Add parameters in the specified order first, including duplicates
  for (const key of paramsOrder) {
    if (keySet.has(key)) {
      const values = searchParams.getAll(key);
      values.forEach(value => orderedParams.append(key, value));
      // Remove the key from allKeys after processing to handle duplicates correctly
      allKeys.splice(allKeys.indexOf(key), 1);
    }
  }
  // Add any remaining parameters that were not included in paramsOrder
  allKeys.forEach(key => {
    const values = searchParams.getAll(key);
    values.forEach(value => orderedParams.append(key, value));
  });
  return orderedParams;
}

(question) how to disable cookie headers?

when i send a request, there are multiple "cookie" header entries (even with defaultheaders set to {}), is there any way i can send with cookies, but without these headers? stock request to emulate has no "cookie" header
immagine

Can't bypass cloudflare's protection

image

URL: https://www.eleze.top/

code:

import tlsClient from 'tlsclientwrapper';
const client = new tlsClient();

console.log(await client.get("https://www.eleze.top/"));

Can you give an example of how to bypass cloudflare protection?

Downloading files (PDFs)

Hi, I would like to download a file (pdf) hosted on an api that has TLS enforcing. When doing a GET request, the response is garbled and cannot be put together into a readable file.

Any ideas on how to implement this / do this ? I would happily write a PR / docs.

[BUG] Memory Issue/Ineffective Garbage Collection

I'm running into problems with memory leaks and ineffective garbage collection.

Steps to Reproduce

  1. Create an instance of the TlsClient wrapper.
  2. Perform a network request using the instance.
  3. Terminate the worker pool.
  4. Observe the memory not fully freeing up, leading to gradual memory build-up.

The test.js includes parts of the test I tried using Heap Snapshots

Expected Behavior
Memory is completely freed up when the worker pool is terminated, preventing any leaks and allowing for long-term stable memory usage.

Actual Behavior
Some memory remains allocated after the worker pool is terminated, leading to eventual memory overflow and crashing the application.

I've tried various approaches to identify and fix the underlying cause but haven't had any success so far.

Thanks!

Missing CJS Support

Hi. Thanks a lot for this amazing library!
Im using pkg and it requires to use ESM module.
im import using:
const tlsClient =require('tlsclientwrapper'); and getting this error:
Error [ERR_REQUIRE_ESM]: require() of ES Module node_modules\tlsclientwrapper\index.js
code: 'ERR_REQUIRE_ESM'
}

thanks!

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.