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
Support alternative transport or proxy #408
Comments
I am currently running into a similar problem with a HTTP(S) proxy, I've also tried SOCKS5 but to no avail. Composer is running fine after the installation inside the php/8.1-fpm-bullseye docker container. Now comes this plugin. I've dug trough some of the error messages and some code to come across this line here composer-patches/src/Plugin/Patches.php Line 317 in fac6b31
It creates it's own RemoteFilesystem instance that apparently isn't aware of any proxy usage and thus fails in an error (for me: "You must enable the curl extension to make https requests through a secure proxy."). I have zero knowledge of PHP but if possible can you use the code used by composer, or get composer to download those resources for you? Otherwise here is the merge that added proxy capabilities to composer, it's quite a old so maybe you're better of looking into the current source code here. Hope to hear back and if I can help in any way just contact me! |
@noot-to-the-noot Thanks a lot for digging into the details. They are very helpful. I was able to put together a PR to fix the issue. |
This feature can improve a lot of developers' lives in China and some behind corporate firewall. @danepowell Can you please consider roll a minor release? or merge it to 1.x-dev? Because most packages who use patches specified |
I merged it into 1.x. Since there's no automated tests on 1.x, this needs extensive manual testing. Can the folks in this thread please test and confirm this works as expected on 1.x-dev before we cut a new release? |
Just to confirm: I have maintained this functionality in #447 as well, so this should continue working in 2.x. |
Let us know if this doesn't work for you and we can reopen. Closing for now. |
Yes, I tested it. It is working in 1.x. All I need to do is |
@skyred if you can provide some details about how you tested, that would be helpful. I'd be open to tagging a 1.x release so you don't have to use a dev version. |
For testing, one would need a proxy server. It could be a remote or at your local. Then, you can up those environment variables, so
Above example is to let docker container use a socks5 proxy on the host machine at port 9999 With the current stable |
When
ALL_PROXY
,HTTPS_PROXY
,HTTP_PROXY
are present in the environment, composer can work with them, but patching stops working, below is an example error message:Probably, this is caused by http client isn't configured to support proxy (
socks5
), the solution is to find the code, and copy it from composer.The text was updated successfully, but these errors were encountered: