Giter Site home page Giter Site logo

bogdanfinn / tls-client-api Goto Github PK

View Code? Open in Web Editor NEW
77.0 77.0 9.0 3.73 GB

This is an application which is using gosoline and TLS-Client to run a simple request forwarding service with the option to use specific tls fingerprints which are implemented in TLS-client

License: BSD 4-Clause "Original" or "Old" License

Shell 5.56% Go 94.44%

tls-client-api's Introduction

Hi there ๐Ÿ‘‹

tls-client-api's People

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar

tls-client-api's Issues

How to add cookies?

Hello,

Just a question not issue, how do I add cookie to session? I am trying to add it like this however its not adding cookies.

setsession
localhost:8080/api/forward
payload: {
"tlsClientIdentifier": "chrome_110",
"requestUrl": "http://httpbin.org/cookies",
"sessionId": "2",
"followRedirects": true,
"requestMethod": "GET",
"withRandomTLSExtensionOrder": true
}

setcookies
localhost:8080/api/cookies
payload: {
"sessionId": "2",
"cookies": [
{
"name": "cookieName",
"value": "cookieValue"
}
]
}

now it should have set the cookies however when i see the body its empty

getcookies
localhost:8080/api/forward
payload: {
"tlsClientIdentifier": "chrome_110",
"requestUrl": "http://httpbin.org/cookies",
"sessionId": "2",
"followRedirects": true,
"requestMethod": "GET",
"withRandomTLSExtensionOrder": true
}

response
"body": "{\n "cookies": {}\n}\n"

Expected
"body": "{\n "cookies": {\n "cookieName": "cookieValue"\n }\n}\n"

Redirect its fails

Forward Request /api/forward

var myHeaders = new Headers();
myHeaders.append("x-api-key", "my-auth-key-1");
myHeaders.append("Content-Type", "application/x-www-form-urlencoded");

var raw = JSON.stringify({
  "tlsClientIdentifier": "chrome_107",
  "requestUrl": "https://auth.spectrasonics.net/useracct/login.php",
  "requestMethod": "POST",
  "followRedirects": true,
  "requestBody": "uname=USER&passwd=PASS&g-recaptcha-response=SOLUTION&submitLogin=true&upgrade=&referrerURL=&redirect=yes"
});

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("127.0.0.1:8080/api/forward", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));


So following request just stucks because cant follow request which is made by body source

<meta http-equiv="refresh" content="0; url=http://www.xxxxxx.com/index.php" />

{"id":"d9e4e1f2-c472-4872-af96-756ca8ebb980","status":200,"target":"https://auth.spectrasonics.net/useracct/login.php","body":" \u003cmeta http-equiv=\"refresh\" content=\"1;url=index.php\" /\u003e\n\n ","headers":{"Cache-Control":["no-store, no-cache, must-revalidate, post-check=0, pre-check=0"],"Content-Type":["text/html; charset=UTF-8"],"Date":["Fri, 06 Jan 2023 17:30:20 GMT"],"Expires":["Thu, 19 Nov 1981 08:52:00 GMT"],"Pragma":["no-cache"],"Referrer-Policy":["no-referrer-when-downgrade"],"Server":["Apache"],"Set-Cookie":["SpectraUA=86l4sja5khojbfe2vdeockt317; path=/; domain=.spectrasonics.net; secure; HttpOnly"],"Strict-Transport-Security":["max-age=31536000; includeSubDomains"],"X-Content-Type-Options":["nosniff"],"X-Frame-Options":["SAMEORIGIN"],"X-Xss-Protection":["1; mode=block"]},"cookies":{"SpectraUA":"86l4sja5khojbfe2vdeockt317"}}

Debug information

Can I somehow get more information about the request in the console, what are the headers, body? "withDebug": True in the request doesn't give me that kind of information

upd:
i use ubuntu
I use a binary file from the dist folder

Adding Cookies to CookieJar

"requestCookies" payload is apparently adding cookies at request level only. how we we append existing cookieJar?

Is it possible to get RAW HTTP response instead of JSON response

Hi, first I want to say thanks for this awesome project! This project literally open up a door for my Python application to allow it to bypass many TLS Fingerprint websites.

From this Issue: FlorianREGAZ/Python-Tls-Client#32

Currently tls-client sends back JSON data:
{....,"headers":{"Access-Control-Allow-Credentials":["true"],"Access-Control-Allow-Origin":["https://rr6-sn-8qj-i5o6k.gooqlevideo.com"],"Age":["72715"],"Alt-Svc":["h3=\":443\"; ma=86400, h3-29=\":443\"; ma=86400"],"Cache-Control":["max-age=31536000"],"Cf-Cache-Status":["HIT"],"Cf-Ray":["79f028e9cf569e28-SIN"],"Content-Encoding":["br"],"Content-Security-Policy":["default-src 'self';base-uri 'self';block-all-mixed-content;font-src 'self' https: data:;form-action 'self';frame-ancestors 'self';img-src 'self' data:;object-src 'none';script-src 'self';script-src-attr 'none';style-src 'self' https: 'unsafe-inline';upgrade-insecure-requests"],"Content-Type":["text/html; charset=utf-8"],"Cross-Origin-Embedder-Policy":["require-corp"],"Cross-Origin-Opener-Policy":["same-origin"],"Date":["Sat, 25 Feb 2023 11:39:19 GMT"],"Expect-Ct":["max-age=0"],"Origin-Agent-Cluster":["?1"],"Referrer-Policy":["no-referrer"],"Server":["cloudflare"],"Strict-Transport-Security":["max-age=31536000; includeSubDomains; preload"],"Vary":["Accept-Encoding","Origin"],"X-Content-Type-Options":["nosniff"],"X-Dns-Prefetch-Control":["off"],"X-Download-Options":["noopen"],"X-Frame-Options":["SAMEORIGIN"],"X-Permitted-Cross-Domain-Policies":["none"],"X-Powered-By":["centminmod"],"X-Xss-Protection":["0","1; mode=block"]},"cookies":{"__cf_bm":"yxyOVhUi38n1UfQujprACZl5yxXyhYZMYl6boMzKKh0-1677324536-0-AdwLPV4avEeaFZNNLGA7VKzwHM3C2rbm2jL/SPwv1WNoRDaahAKij0hWwlApbK52ErrqT3pGG+pCYWIZlOzkM9o="}}

instead of RAW HTTP data like this:

HTTP/1.1 200 OK
Cache-Control: no-store
Pragma: no-cache
Date: Fri, 24 Feb 2023 18:51:16 GMT
Content-Type: text/html; charset=utf-8
Vary: Accept-Encoding
Vary: Origin
Content-Security-Policy: default-src * 'unsafe-inline' 'unsafe-eval' blob: data:;base-uri 'self';block-all-mixed-content;font-src 'self' https: data:;form-action 'self';frame-ancestors 'self';img-src * 'self' blob: data: 'unsafe-inline' 'unsafe-eval';object-src 'none';script-src * 'unsafe-inline' 'unsafe-eval' blob: data:;script-src-attr 'none';style-src * 'unsafe-inline' 'unsafe-eval' blob: data:;upgrade-insecure-requests;prefetch-src 'none';
Cross-Origin-Embedder-Policy: require-corp
Cross-Origin-Opener-Policy: same-origin
X-DNS-Prefetch-Control: off
Expect-CT: max-age=0
X-Frame-Options: SAMEORIGIN
X-Download-Options: noopen
X-Content-Type-Options: nosniff
Origin-Agent-Cluster: ?1
X-Permitted-Cross-Domain-Policies: none
Referrer-Policy: no-referrer
X-XSS-Protection: 0
X-XSS-Protection: 1; mode=block
Access-Control-Allow-Origin: https://rr6-sn-8qj-i5o6k.gooqlevideo.com
Access-Control-Allow-Credentials: true
X-Powered-By: centminmod
Old-Cache-Control: max-age=31536000
CF-Cache-Status: HIT
Age: 363739
Server: cloudflare
CF-RAY: 79ea644469696bc7-SIN
Old-Content-Encoding: br
Old-Transfer-Encoding: chunked
Content-Length: 778320

<long.................body data>

Which is not ideal for streaming data back to another client, and streaming data is very usueful in cases:

  • The data is too big for client memory to handle, which causes OOM (out-of-memory) error
  • Sometimes client want to abort request as soon as possible, so downloading the whole response body is kinda waste, especially if response body is huge (100MB+)

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.