Skip to content

Support HTTP forward proxy in ngx.fetch() #956

@route443

Description

@route443

Is your feature request related to a problem? Please describe

Corporate environments often require some/all egress traffic to pass through a forward proxy. In nginx+njs, subrequests cannot be used for this (nginx oss/plus lacks HTTP CONNECT support), so ngx.fetch() is the only outgoing http client available inside njs. Today ngx.fetch() has no way to use a connect method.

Describe the solution you'd like

await ngx.fetch(url, {
  method: 'GET',
  headers,
  body,
  proxy: 'http://user:pass@proxy.example.com:3128',
  proxy_auth: { scheme: 'basic' } // maybe this is unnecessary
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions