My corporate network works with a PAC script.(http://proxyconf.xxx.yy-ss/proxy.pac).
Using the PAC script in the "git config" command does not work. "git config --global http.proxy http://proxyconf.xxx.yy-ss/proxy.pac"
I got it to work by downloading the proxy.pac script (100 odd entries), selecting the most generic (usually the bottom most) proxy, and using it with my credentials in the "git config --global http.proxy" command.
I have already asked about making git work through a proxy server:
Getting git to work with a proxy server
How do I pull from a Git repository through an HTTP proxy?
but the above questions make no mention of PAC scripts.
Is there some setting with which I can directly use the proxy.pac script?
Setting the proxy for Git Run the following commands replacing USERNAME , PASSWORD , PROXY_ADDRESS , and PROXY_PORT with your network's information: git config --global --add http. proxy http://USERNAME:PASSWORD@PROXY_ADDRESS:PROXY_PORT.
PAC files are typically hosted on a web server and are named proxy. pac. Since PAC files contain the configuration in plain text. You can use a text editor, such as Microsoft Notepad or Apple TextEdit to view or modify the files.
You would need to configure git and make it reference your own proxy server, one using your PAC file.
See for instance liangqing/PacProxy
A socks proxy server that use PAC file to decide how to forward request
Features
- Implement a socks server(support socks4 and socks5, no authentication module)
- Using PAC file to decide how to forward request
As mentioned in "Using a socks proxy with git for the http transport", you need to configure git as:
git config --global http.proxy 'socks5://127.0.0.1:9999'
No need to configure https.proxy
: this does not exist in the Git codebase.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With