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
serenity-bdd update ignores proxy settings #356
Comments
Hi, You simply put AXIOS dependency in your package.json ( npm i --save axios) and run serenity-bdd update. It should work. Lets try and let us know. |
Hi @JoeChester, Could you please have a look at the Serenity/JS template project and see if you can use it to download the Serenity BDD jar behind the proxy? The project is configured to do it As per @abhinaba1080's comment above, Serenity/JS version 2 uses the axios http client, which should be installed as one of your (dev) dependencies ( The |
hey, @jan-molak , Even I am facing issues with the newer
With the deprecated |
Hey @JoeChester, @okey-right - would you be able to share the (anonymised) proxy configuration you're using? I'd be curious to understand if the issues you're seeing are caused by using a http proxy with a https repo url. |
hey @jan-molak , - It's a (PAC) Proxy auto-configuration. Goes like http://pac.xxxxxxxxx.com.xx/wpad.dat |
@jan-molak , Were you able to check this out ? Thanks. |
@jan-molak same problem here. We have a HTTP proxy without authentification for HTTP/HTTPS requests. Same error on linux and windows clients. Let me know if I can provide more details for solving the issue. |
@habmukandu - do you use a It doesn't seem like |
no, I defined the proxy in environment with 'https_proxy' (http://proxy.corproot.net:8079) However, it seems to be a general problem with Axios and Squid proxies. I left a comment on Axios issues to reproduce it: link When using a modified version of Axios using 'https-proxy-agent' it works with our proxy. |
@habmukandu - I see, so the solution seems to be to intelligently choose the appropriate proxy agent based on the config the developer has provided. Thinking out loud Could we have something along those lines:
The Does this logic sound about right? Or am I missing something? |
@jan-molak - sure this would solve the issue. The drawback is the need of specifying a proxy config before running npm install in some cases. I would recommend to use the same proxy behaviour as npm uses:
const axiosConfig = {
proxy: false
};
const HttpsProxyAgent = require("https-proxy-agent");
const proxyConfig = process.env.HTTPS_PROXY || process.env.https_proxy || process.env.npm_config_https_proxy || process.env.HTTP_PROXY || process.env.http_proxy || process.env.npm_config_proxy || false;
const httpsAgent = new HttpsProxyAgent(proxyConfig);
Object.assign(axiosConfig, proxyConfig ? {httpsAgent: httpsAgent} : null);
const axios = require("axios").create(axiosConfig); This would work for users having proxy configured in env or npm. I think PAC support is not needed as npm is also not supporting it. |
That's a good point about NPM not supporting the pac files, @habmukandu. @okey-right - how do you install the node modules in your setup? How does npm learn about the |
@jan-molak - The pac file comes pre-configured on the windows machine for everyone on a system level. Everything network action on the system goes through the configuration on the pac file by default. I am able to download all other dependencies including other serenity js dependencies. But only face problems during fetching the cli when running the serenity-bdd update command. |
@okey-right when a PAC file is configured for a windows machine applications are not automatically forced to use the PAC settings. Applications like Chrome or Edge will always use the system proxy configuration while others like NPM completely ignore it. When npm install works for you behind a proxy then I would imagine that you have configured a proxy in environment (https_proxy) or in your .npmrc file in your home directory. |
As of 2.17.4, It turned out to be a bit more involved than I had hoped. |
Hello everyone, I am having troubles with using the
serenity-bdd update
command behind a corporate http proxy.As far as I understand,
@serenity-js/serenity-bdd
package has deprecated theserenity-cli
package, right?.I have configured my corporate proxy settings as environment variable for node. With the deprecated
serenity update
command, the proxy settings are accepted and the serenity .jar file is downloaded and put into thenode_modules/serenity-js/.cache
folder. However, with the newerserenity-bdd update
command, I either get the error messagewhen I use the HTTP_PROXY environment variable, or
when I use the HTTPS_PROXY environment variable.
I'd really like to use the newer
@serenity-js/serenity-bdd
package, as it lets me create reports with Java 11+ as well.The old cli fails on the Java warning
while the newer cli still produces that warning, but ignores it and produces the report regardless.
My current workaround is to download the .jar file with the old cli-downloader and reference it with the new cli via the
--cacheDir
command line option. But this means I can not remove the deprecatedserenity-cli
dependency in favor of the newer one right now.Is there a chance that the newer update cli can respect the system http proxy settings?
#135 might be related to that, but I think it used the old cli.
The text was updated successfully, but these errors were encountered: