-
-
Notifications
You must be signed in to change notification settings - Fork 153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] HTTP_PROXY Support No Longer Works #714
[BUG] HTTP_PROXY Support No Longer Works #714
Comments
@wing328 Thanks for highlighting me, I can try, but unfortunately I could not reproduce the problem :( @mdgilene Thanks for reporting the issue. I tried to reproduce it, but for me everything seems to work fine. Here is what I did: Then I proceeded to set the proxy environment: I removed the node_modules in that project to have a clean start again and executed the generation task again Long story short: What can I do to reproduce your error? [1] https://www.mock-server.com/mock_server/mockserver_ui.html |
I'm facing the same issue, openapi-generator-cli is not using the proxy, therefore it is unable to download the jar file from maven. This might be related: axios/axios#2072 EDIT: it might actually be related to the HTTP method used to go through the proxy. If you use a proxy that simply forwards requests it will work (for http, not for https), but if your proxy relies on the CONNECT method and denies other methods (which is usually how corporate proxies work), it won't work. The workaround seems to be: const HttpsProxyAgent = require('https-proxy-agent');
const axiosDefaultConfig = {
baseURL: 'https://domain.tld/api',
proxy: false,
httpsAgent: new HttpsProxyAgent('http://127.0.0.1:8080')
}; Of course the |
I ran into this issue as well. Based on what @ShellCode33 pointed out ( #714 (comment) ) and the initial implementation 66b78ff , I was able to resolve it with the following code: // apps/generator-cli/src/app/app.module.ts
import { HttpsProxyAgent } from 'https-proxy-agent';
const proxyUrl = process.env.HTTP_PROXY || process.env.HTTPS_PROXY;
const httpModuleConfig: HttpModuleOptions = {};
if (proxyUrl) {
httpModuleConfig.proxy = false;
httpModuleConfig.httpsAgent = new HttpsProxyAgent(proxyUrl);
}
@Module({
imports: [
HttpModule.register({
...httpModuleConfig,
}),
],
// ...
})
export class AppModule implements OnApplicationBootstrap {
// ...
} However, I just noticed that there's also a draft pull request with a similar approach: #752 . I'm thinking about opening another PR, but unfortunately I'm not that deep into proxies and not too sure if my implementation might break things... 😅 |
please open a PR to start with and we'll start from there. |
* chore(deps): install `https-proxy-agent` as dependency * fix(app): configure http agent with proxy url if present in environment Fixes ##714
🎉 This issue has been resolved in version 2.13.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
… v2.13.2 (#1045) [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [@openapitools/openapi-generator-cli](https://togithub.com/OpenAPITools/openapi-generator-cli) | [`2.13.1` -> `2.13.2`](https://renovatebot.com/diffs/npm/@openapitools%2fopenapi-generator-cli/2.13.1/2.13.2) | [![age](https://developer.mend.io/api/mc/badges/age/npm/@openapitools%2fopenapi-generator-cli/2.13.2?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@openapitools%2fopenapi-generator-cli/2.13.2?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@openapitools%2fopenapi-generator-cli/2.13.1/2.13.2?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@openapitools%2fopenapi-generator-cli/2.13.1/2.13.2?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>OpenAPITools/openapi-generator-cli (@​openapitools/openapi-generator-cli)</summary> ### [`v2.13.2`](https://togithub.com/OpenAPITools/openapi-generator-cli/releases/tag/v2.13.2) [Compare Source](https://togithub.com/OpenAPITools/openapi-generator-cli/compare/v2.13.1...v2.13.2) ##### Bug Fixes - **app:** configure http with proxy url if present in environment ([#​762](https://togithub.com/OpenAPITools/openapi-generator-cli/issues/762)) ([7787f07](https://togithub.com/OpenAPITools/openapi-generator-cli/commit/7787f07edfe5a9d8d5272646bf54311a31c89e62)), closes [OpenAPITools/openapi-generator-cli#714](https://togithub.com/OpenAPITools/openapi-generator-cli/issues/714) </details> --- ### Configuration 📅 **Schedule**: Branch creation - "every weekday" in timezone Etc/UTC, Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/ScaleLeap/selling-partner-api-sdk). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4yOTMuMCIsInVwZGF0ZWRJblZlciI6IjM3LjI5My4wIiwidGFyZ2V0QnJhbmNoIjoibWFzdGVyIiwibGFiZWxzIjpbInJlbm92YXRlYm90Il19--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [@openapitools/openapi-generator-cli](https://togithub.com/OpenAPITools/openapi-generator-cli) | [`2.9.0` -> `2.13.4`](https://renovatebot.com/diffs/npm/@openapitools%2fopenapi-generator-cli/2.9.0/2.13.4) | [![age](https://developer.mend.io/api/mc/badges/age/npm/@openapitools%2fopenapi-generator-cli/2.13.4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@openapitools%2fopenapi-generator-cli/2.13.4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@openapitools%2fopenapi-generator-cli/2.9.0/2.13.4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@openapitools%2fopenapi-generator-cli/2.9.0/2.13.4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>OpenAPITools/openapi-generator-cli (@​openapitools/openapi-generator-cli)</summary> ### [`v2.13.4`](https://togithub.com/OpenAPITools/openapi-generator-cli/releases/tag/v2.13.4) [Compare Source](https://togithub.com/OpenAPITools/openapi-generator-cli/compare/v2.13.3...v2.13.4) ##### Bug Fixes - **deps:** update dependency [@​nestjs/axios](https://togithub.com/nestjs/axios) to v3.0.2 ([#​765](https://togithub.com/OpenAPITools/openapi-generator-cli/issues/765)) ([37597a2](https://togithub.com/OpenAPITools/openapi-generator-cli/commit/37597a25e0959b970ced8c5d1ada70700f045d81)) ### [`v2.13.3`](https://togithub.com/OpenAPITools/openapi-generator-cli/releases/tag/v2.13.3) [Compare Source](https://togithub.com/OpenAPITools/openapi-generator-cli/compare/v2.13.2...v2.13.3) ##### Bug Fixes - **deps:** update dependency axios to v1.6.8 ([#​766](https://togithub.com/OpenAPITools/openapi-generator-cli/issues/766)) ([5dff424](https://togithub.com/OpenAPITools/openapi-generator-cli/commit/5dff424aa15a2e23693d092bf42050a7df290601)) ### [`v2.13.2`](https://togithub.com/OpenAPITools/openapi-generator-cli/releases/tag/v2.13.2) [Compare Source](https://togithub.com/OpenAPITools/openapi-generator-cli/compare/v2.13.1...v2.13.2) ##### Bug Fixes - **app:** configure http with proxy url if present in environment ([#​762](https://togithub.com/OpenAPITools/openapi-generator-cli/issues/762)) ([7787f07](https://togithub.com/OpenAPITools/openapi-generator-cli/commit/7787f07edfe5a9d8d5272646bf54311a31c89e62)), closes [OpenAPITools/openapi-generator-cli#714](https://togithub.com/OpenAPITools/openapi-generator-cli/issues/714) ### [`v2.13.1`](https://togithub.com/OpenAPITools/openapi-generator-cli/releases/tag/v2.13.1) [Compare Source](https://togithub.com/OpenAPITools/openapi-generator-cli/compare/v2.13.0...v2.13.1) ##### Reverts - Revert "fix(deps): update dependency reflect-metadata to v0.2.1 ([#​773](https://togithub.com/OpenAPITools/openapi-generator-cli/issues/773))" ([#​777](https://togithub.com/OpenAPITools/openapi-generator-cli/issues/777)) ([fb01b0b](https://togithub.com/OpenAPITools/openapi-generator-cli/commit/fb01b0b6416a7a32da1c11fccda77f150e57df84)), closes [#​773](https://togithub.com/OpenAPITools/openapi-generator-cli/issues/773) [#​777](https://togithub.com/OpenAPITools/openapi-generator-cli/issues/777) ### [`v2.13.0`](https://togithub.com/OpenAPITools/openapi-generator-cli/releases/tag/v2.13.0) [Compare Source](https://togithub.com/OpenAPITools/openapi-generator-cli/compare/v2.12.1...v2.13.0) ##### Features - **[#​644](https://togithub.com/OpenAPITools/openapi-generator-cli/issues/644):** add cli option for openapitools.json ([#​754](https://togithub.com/OpenAPITools/openapi-generator-cli/issues/754)) ([1d2a1a2](https://togithub.com/OpenAPITools/openapi-generator-cli/commit/1d2a1a2b40e0b509970f4b1c65190448237e4f1e)), closes [#​644](https://togithub.com/OpenAPITools/openapi-generator-cli/issues/644) ### [`v2.12.1`](https://togithub.com/OpenAPITools/openapi-generator-cli/releases/tag/v2.12.1) [Compare Source](https://togithub.com/OpenAPITools/openapi-generator-cli/compare/v2.12.0...v2.12.1) ##### Bug Fixes - **deps:** update dependency reflect-metadata to v0.2.1 ([#​773](https://togithub.com/OpenAPITools/openapi-generator-cli/issues/773)) ([f6dcb95](https://togithub.com/OpenAPITools/openapi-generator-cli/commit/f6dcb9557cf1549e9b07da1b274d1d9a90ad5c70)) ### [`v2.12.0`](https://togithub.com/OpenAPITools/openapi-generator-cli/releases/tag/v2.12.0) [Compare Source](https://togithub.com/OpenAPITools/openapi-generator-cli/compare/v2.11.0...v2.12.0) ##### Features - **release:** trigger a release ([ad97182](https://togithub.com/OpenAPITools/openapi-generator-cli/commit/ad97182dac3fc2fec59c70fa96e7213d0a475dd3)) ### [`v2.11.0`](https://togithub.com/OpenAPITools/openapi-generator-cli/releases/tag/v2.11.0) [Compare Source](https://togithub.com/OpenAPITools/openapi-generator-cli/compare/v2.10.1...v2.11.0) ##### Features - **release:** trigger a release ([7e43a4e](https://togithub.com/OpenAPITools/openapi-generator-cli/commit/7e43a4e4f91148dede80fb7849eb473db759eb17)) ### [`v2.10.1`](https://togithub.com/OpenAPITools/openapi-generator-cli/releases/tag/v2.10.1) [Compare Source](https://togithub.com/OpenAPITools/openapi-generator-cli/compare/v2.10.0...v2.10.1) ##### Reverts - Revert "support JAVA_HOME environment variable ([#​756](https://togithub.com/OpenAPITools/openapi-generator-cli/issues/756))" ([#​761](https://togithub.com/OpenAPITools/openapi-generator-cli/issues/761)) ([2a9aef9](https://togithub.com/OpenAPITools/openapi-generator-cli/commit/2a9aef9ca4bd1a197bdf414e0ba24b1c4d7d6a28)), closes [#​756](https://togithub.com/OpenAPITools/openapi-generator-cli/issues/756) [#​761](https://togithub.com/OpenAPITools/openapi-generator-cli/issues/761) ### [`v2.10.0`](https://togithub.com/OpenAPITools/openapi-generator-cli/releases/tag/v2.10.0) [Compare Source](https://togithub.com/OpenAPITools/openapi-generator-cli/compare/v2.9.0...v2.10.0) ##### Features - **release:** trigger a release ([5d0e7c0](https://togithub.com/OpenAPITools/openapi-generator-cli/commit/5d0e7c0fc1076ba783424c89bf61c9bff6f112ed)) </details> --- ### Configuration 📅 **Schedule**: Branch creation - "every 2nd week starting on the 2 week of the year before 4am on Monday" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/bitwarden/sdk). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zNTEuMiIsInVwZGF0ZWRJblZlciI6IjM3LjM1MS4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
🐛 Bug Report:
Describe the bug
This commit which swapped to a new HttpModule implementation completely removed the ability to use the CLI behind any kind of proxy.
66b78ff
Expected behavior
HttpModule is configured with HTTP_PROXY, HTTPS_PROXY, and NO_PROXY
The text was updated successfully, but these errors were encountered: