tls-devicer
    Preparing search index...

    Function createTlsMiddleware

    • Create an Express/Connect/Fastify-compatible middleware that passively collects TLS and HTTP/2 fingerprint signals from every request and attaches a TlsProfile to req.tlsProfile.

      The middleware itself does not call TlsManager.analyze() — attach the extracted profile by passing req.tlsProfile in to your identity call (or use TlsManager.registerWith(deviceManager) for automatic injection).

      import { createTlsMiddleware } from 'tls-devicer';
      app.use(createTlsMiddleware());

      app.post('/identify', async (req, res) => {
      const result = await deviceManager.identify(req.body, {
      tlsProfile: req.tlsProfile,
      });
      });
      # Stock nginx cannot generate JA4 itself.
      # Forward a JA4 header from an upstream edge such as Cloudflare.
      proxy_set_header X-JA4 $http_cf_ja4;
      

      Returns (req: TlsRequest, _res: ServerResponse, next: NextFunction) => void