Skip to content

Missing TLS overhead in byte statistics when using HTTPS upstream proxy #606

@bliuchak

Description

@bliuchak

When using an HTTPS upstream proxy, connection statistics (trgRxBytes/trgTxBytes) only count application-layer bytes and miss TLS overhead.

This affects both handlers:

  • forward.ts (HTTP requests via HTTPS upstream)
  • chain.ts (CONNECT tunneling via HTTPS upstream)

Expected behavior: Byte counts should include all TCP bytes by accessing the _parent socket of TLS connection.

npm run test test/https_upstream_tls_overhead.js
...
  2 passing (1s)
  2 failing

  1) forward.ts TLS overhead with HTTPS upstream
       should demonstrate missing TLS overhead with HTTPS upstream proxy:

      counted trgRxBytes 171 not equal to actual upstream count 2300
      + expected - actual

      -171
      +2300

      at Context.<anonymous> (test/https_upstream_tls_overhead.js:230:44)

  2) chain.ts TLS overhead with HTTPS upstream
       should demonstrate missing TLS overhead with HTTPS upstream proxy (chain handler):

      counted trgRxBytes 2339 not equal to actual upstream count 4512
      + expected - actual

      -2339
      +4512

      at Context.<anonymous> (test/https_upstream_tls_overhead.js:495:44)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working.medium priorityMedium priority issues to be done in a couple of sprints.t-core-servicesIssues with this label are in the ownership of the core services team.t-unblockingIssues with this label are in the ownership of the unblocking team.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions