CLI does not work behind proxy
See original GitHub issueDescribe the bug Configuring HTTP_PROXY_* environment variables does not affect CLI behaviour. It is not possible to use CLI behind proxy.
To Reproduce
- Run CLI with proxy configured. Based on code here https://github.com/crowdin/crowdin-cli/blob/89e4684cdfad9a61ad86616255ca32551f3a8761/src/main/java/com/crowdin/cli/Cli.java#L31
HTTP_PROXY_HOST=proxy.example.com HTTP_PROXY_PORT=8080 HTTP_PROXY_USER=user HTTP_PROXY_PASSWORD=password java -jar crowdin-cli.jar upload
- Get an error
[ERROR] Fetching project info
java.lang.RuntimeException: Failed to collect project info. Please contact our support team for help
ββββββββat com.crowdin.cli.utils.console.ConsoleSpinner.execute(ConsoleSpinner.java:29)
ββββββββat com.crowdin.cli.commands.actions.UploadSourcesAction.act(UploadSourcesAction.java:65)
ββββββββat com.crowdin.cli.commands.picocli.ClientActCommand.act(ClientActCommand.java:25)
ββββββββat com.crowdin.cli.commands.picocli.GenericCommand.run(GenericCommand.java:57)
ββββββββat picocli.CommandLine.executeUserObject(CommandLine.java:1919)
ββββββββat picocli.CommandLine.access$1100(CommandLine.java:145)
ββββββββat picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2332)
ββββββββat picocli.CommandLine$RunLast.handle(CommandLine.java:2326)
ββββββββat picocli.CommandLine$RunLast.handle(CommandLine.java:2291)
ββββββββat picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2159)
ββββββββat picocli.CommandLine.execute(CommandLine.java:2058)
ββββββββat com.crowdin.cli.commands.picocli.PicocliRunner.execute(PicocliRunner.java:36)
ββββββββat com.crowdin.cli.Cli.main(Cli.java:19)
Caused by: java.lang.RuntimeException: Error from server: <Code: <empty_code>, Message: Connect to api.crowdin.com:443 [api.crowdin.com/34.233.13.83, api.crowdin.com/3.220.221.31, api.crowdin.com/107.21.48.25] failed: Connection timed out: connect>
ββββββββat com.crowdin.cli.client.CrowdinClientCore.executeRequest(CrowdinClientCore.java:109)
ββββββββat com.crowdin.cli.client.CrowdinClientCore.executeRequest(CrowdinClientCore.java:82)
ββββββββat com.crowdin.cli.client.CrowdinClient.getProject(CrowdinClient.java:97)
ββββββββat com.crowdin.cli.client.CrowdinClient.populateProjectWithInfo(CrowdinClient.java:81)
ββββββββat com.crowdin.cli.client.CrowdinClient.downloadFullProject(CrowdinClient.java:42)
ββββββββat com.crowdin.cli.utils.console.ConsoleSpinner.execute(ConsoleSpinner.java:24)
ββββββββ... 12 more
Expected behavior It would be great to have clear documentation how to use CLI with proxy configuration.
Works fine:
export https_proxy=http://user:password@proxy.example.com
curl https://api.crowdin.com
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (3 by maintainers)
Top Results From Across the Web
Using an HTTP proxy - AWS Command Line Interface
To access AWS through proxy servers, you can configure the HTTP_PROXY and HTTPS_PROXY environment variables with either the DNS domain names or IP...
Read more >CDK CLI does not work through corporate proxy. #645 - GitHub
CDK CLI does not work when the user connected to the internet through the proxy. I get "connect ECONNREFUSED 54.240.195.235:443" error.
Read more >Use Azure CLI 2.0 behind corporate proxy server
For some time Azure CLI was not supported behind corporate proxies at all. However it seems that this was fixed in 2015.03.04 Version...
Read more >Angular-CLI proxy to backend doesn't work - Stack Overflow
I'm getting an error that http://localhost:4200/api/hello 404 (Not Found) . As we can see, nothing has been proxied. Why? Did I do somethingΒ ......
Read more >AWS CLI not working behind proxy - Reddit
I'm trying to get aws cli working through a proxy on a Windows instance but not having any luck, specifically for an instance...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi!
Thanks for this update. I can confirm that this build works fine (both upload and download) and there is no need to pass extra proxy properties directly to java.
Hi!
the fix on new build worked like a charm π