https-tls

1.0.16 • Public • Published

https-tls

Last version Coverage Status NPM Status

Setup HTTPS details related to TLS according to the User Agent provided. Source code from got-scraping.

Install

$ npm install https-tls --save

Usage

'use strict'

const uniqueRandomArray = require('unique-random-array')
const userAgents = require('top-user-agents')
const tls = require('https-tls')

const randomUserAgent = uniqueRandomArray(userAgents)

const userAgent = randomUserAgent()
const https = tls(userAgent)

console.log(https)
// {
//   ciphers: 'TLS_AES_128_GCM_SHA256:TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:…',
//   signatureAlgorithms: 'ecdsa_secp256r1_sha256:rsa_pss_rsae_sha256:rsa_pkcs1_sha256…',
//   ecdhCurve: 'X25519:prime256v1:secp384r1',
//   minVersion: 'TLSv1',
//   maxVersion: 'TLSv1.3'
// }

You can also setup it as got hook:

'use strict'

const got = require('got')
const tlsHook = require('https-tls/hook')

const instance = got.extend({
  hooks: {
    beforeRequest: [
      tlsHook
    ]
  }
})

License

https-tls © Kiko Beats, released under the MIT License.
Authored and maintained by Kiko Beats with help from contributors.

kikobeats.com · GitHub Kiko Beats · Twitter @Kikobeats

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.16
    15
    • latest

Version History

Package Sidebar

Install

npm i https-tls

Weekly Downloads

36

Version

1.0.16

License

MIT

Unpacked Size

12.8 kB

Total Files

7

Last publish

Collaborators

  • kikobeats