{"id":19241438,"url":"https://github.com/axa-group/native-proxy-agent","last_synced_at":"2025-08-03T13:06:28.783Z","repository":{"id":40787473,"uuid":"408377132","full_name":"axa-group/native-proxy-agent","owner":"axa-group","description":"A http and https agent for working with proxies that allow keep-alive connections","archived":false,"fork":false,"pushed_at":"2024-09-27T20:53:55.000Z","size":2108,"stargazers_count":8,"open_issues_count":5,"forks_count":1,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-06-30T06:05:09.952Z","etag":null,"topics":["agent","http","https","keep-alive","nodejs","proxy","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/axa-group.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.TXT","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-09-20T09:09:31.000Z","updated_at":"2025-01-18T18:52:24.000Z","dependencies_parsed_at":"2023-02-12T05:01:44.109Z","dependency_job_id":"5295b3f3-7fee-46e5-9cb4-1c2adb4c5904","html_url":"https://github.com/axa-group/native-proxy-agent","commit_stats":{"total_commits":117,"total_committers":6,"mean_commits":19.5,"dds":"0.11965811965811968","last_synced_commit":"8c9cdc73c7134a8092ffa649240a66882fb7574c"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/axa-group/native-proxy-agent","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axa-group%2Fnative-proxy-agent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axa-group%2Fnative-proxy-agent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axa-group%2Fnative-proxy-agent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axa-group%2Fnative-proxy-agent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/axa-group","download_url":"https://codeload.github.com/axa-group/native-proxy-agent/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axa-group%2Fnative-proxy-agent/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266039003,"owners_count":23867815,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agent","http","https","keep-alive","nodejs","proxy","typescript"],"created_at":"2024-11-09T17:11:28.604Z","updated_at":"2025-07-19T23:09:46.184Z","avatar_url":"https://github.com/axa-group.png","language":"TypeScript","readme":"# Native Proxy Agent\n\n[![CI](https://github.com/axa-group/native-proxy-agent/actions/workflows/main.yml/badge.svg)](https://github.com/axa-group/native-proxy-agent/actions/workflows/main.yml)\n\nA native proxy agent that uses the native nodejs `http.Agent` and `https.Agent` to proxy the requests.\n\n**_All agents allow http or https proxy but you have to select over the agent depending on your target url._**\n\n## How to install\n\n```console\n  npm install @axa/native-proxy-agent\n```\n\n## Usage\n\n```js\nconst { createAgent } = require('@axa/native-proxy-agent');\nconst got = require('got');\n\ngot('http://requestUrl.com/service/1', {\n  agent: createAgent('http://requestUrl.com/service/1')\n});\n```\n\n- You can also directly create an httpsAgent or an httpAgent\n\n```js\nconst { createHttpAgent } = require('@axa/native-proxy-agent');\nconst got = require('got');\n\ngot('http://requestUrl.com/service/1', {\n  agent: {\n    http: createHttpAgent()\n  }\n});\n```\n\n```js\nconst { createHttpsAgent } = require('@axa/native-proxy-agent');\nconst got = require('got');\n\ngot('http://requestUrl.com/service/1', {\n  agent: {\n    https: createHttpsAgent()\n  }\n});\n```\n\n- `createForeverAgent` will add to a singleton, agents with the same configuration to allow an easy reuse of the agents. Also this method will set the option `keepAlive` to true by default.\n\n```js\nconst { createForeverAgent } = require('@axa/native-proxy-agent');\nconst got = require('got');\n\ngot('http://requestUrl.com/service/1', {\n  agent: {\n    https: createForeverAgent('http://requestUrl.com/service/1')\n  }\n});\n\n// Target with same protocol and agent options will share same agent\ngot('http://requestUrl.com/another-service', {\n  agent: {\n    http: createForeverAgent('http://requestUrl.com/another-service')\n  }\n});\n```\n\n- If the protocol of the requests is always the same, you can create a target https or http `Agent`.\n  - `createHttpForeverAgent`\n  - `createHttpsForeverAgent`\n\n### Environment variables\n\n`@axa/native-proxy-agent` will pick the proxy configuration from the environment if the options are not provided at the creation of the agent. It will also pick environment variables for making unproxied (`no_proxy` and `NO_PROXY`) requests.\n\nThe environment variables used for this purpose are:\n\n- Setting the proxy: http_proxy, https_proxy, HTTP_PROXY, and HTTPS_PROXY.\n- Proxy exemptions: no_proxy and NO_PROXY.\n\nThe preference of variable is the order in which they are written in this readme.\n\n## Contributing\n\nYou can read the guide of how to contribute at [Contributing](./CONTRIBUTING.md).\n\n## Code of Conduct\n\nYou can read the Code of Conduct at [Code of Conduct](./CODE_OF_CONDUCT.md).\n\n# Legal Notice\n\nCopyright (c) AXA Group. All rights reserved.\nLicensed under the MIT License.\n\n## Third party dependencies licenses\n\n### Production\n - [hyperid@3.0.1](https://github.com/mcollina/hyperid) - MIT\n - [node-object-hash@2.3.10](https://github.com/SkeLLLa/node-object-hash) - MIT\n\n### Development\n - [@commitlint/config-conventional@17.0.2](https://github.com/conventional-changelog/commitlint) - MIT\n - [@types/jest@28.1.3](https://github.com/DefinitelyTyped/DefinitelyTyped) - MIT\n - [@types/node@18.0.0](https://github.com/DefinitelyTyped/DefinitelyTyped) - MIT\n - [@typescript-eslint/eslint-plugin@5.29.0](https://github.com/typescript-eslint/typescript-eslint) - MIT\n - [@typescript-eslint/parser@5.29.0](https://github.com/typescript-eslint/typescript-eslint) - BSD-2-Clause\n - [commitizen@4.2.4](https://github.com/commitizen/cz-cli) - MIT\n - [commitlint@17.0.2](https://github.com/conventional-changelog/commitlint) - MIT\n - [cz-conventional-changelog@3.3.0](https://github.com/commitizen/cz-conventional-changelog) - MIT\n - [eslint@8.18.0](https://github.com/eslint/eslint) - MIT\n - [eslint-config-airbnb-base@15.0.0](https://github.com/airbnb/javascript) - MIT\n - [eslint-config-airbnb-typescript@17.0.0](https://github.com/iamturns/eslint-config-airbnb-typescript) - MIT\n - [eslint-config-prettier@8.5.0](https://github.com/prettier/eslint-config-prettier) - MIT\n - [eslint-import-resolver-typescript@2.7.1](https://github.com/alexgorbatchev/eslint-import-resolver-typescript) - ISC\n - [eslint-plugin-import@2.26.0](https://github.com/import-js/eslint-plugin-import) - MIT\n - [eslint-plugin-jest@26.5.3](https://github.com/jest-community/eslint-plugin-jest) - MIT\n - [eslint-plugin-json@3.1.0](https://github.com/azeemba/eslint-plugin-json) - MIT\n - [eslint-plugin-prettier@4.0.0](https://github.com/prettier/eslint-plugin-prettier) - MIT\n - [got@11.8.5](https://github.com/sindresorhus/got) - MIT\n - [husky@8.0.1](https://github.com/typicode/husky) - MIT\n - [jest@28.1.1](https://github.com/facebook/jest) - MIT\n - [nock@13.2.7](https://github.com/nock/nock) - MIT\n - [prettier@2.7.1](https://github.com/prettier/prettier) - MIT\n - [rimraf@3.0.2](https://github.com/isaacs/rimraf) - ISC\n - [standard-version@9.5.0](https://github.com/conventional-changelog/standard-version) - ISC\n - [ts-jest@28.0.5](https://github.com/kulshekhar/ts-jest) - MIT\n - [typescript@4.7.x](https://github.com/Microsoft/TypeScript) - Apache-2.0\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faxa-group%2Fnative-proxy-agent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faxa-group%2Fnative-proxy-agent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faxa-group%2Fnative-proxy-agent/lists"}