有什么方法可以让git直接与.pac(代理自动配置)脚本一起使用? [英] Is there any way to get git to work directly with a .pac (proxy auto-config) script?

查看:270
本文介绍了有什么方法可以让git直接与.pac(代理自动配置)脚本一起使用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的公司网络使用PAC脚本.( http://proxyconf.xxx.yy-ss/proxy.pac ).

My corporate network works with a PAC script.(http://proxyconf.xxx.yy-ss/proxy.pac).

在"git config"命令中使用PAC脚本不起作用."git配置--global http.proxy 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"

我通过下载proxy.pac脚本(100个奇数条目),选择了最通用的(通常是最底端的)代理,并在"git config --global http.proxy"中将其与我的凭据一起使用来使其工作命令.

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.

我已经问过有关通过代理服务器使git工作的问题:

I have already asked about making git work through a proxy server:

如何做我是通过HTTP代理从Git存储库中拉出的吗?

但以上问题并未提及PAC脚本.

but the above questions make no mention of PAC scripts.

是否可以直接使用proxy.pac脚本进行某些设置?

Is there some setting with which I can directly use the proxy.pac script?

推荐答案

您需要配置git并使其引用您自己的代理服务器,其中一个使用PAC文件.

You would need to configure git and make it reference your own proxy server, one using your PAC file.

例如查看> liangqing/PacProxy >

使用PAC文件决定如何转发请求的袜子代理服务器

A socks proxy server that use PAC file to decide how to forward request

  • 实现一个袜子服务器(支持socks4和socks5,无身份验证模块)
  • 使用PAC文件来决定如何转发请求

如"使用带有git的袜子代理进行http传输中所述,您需要将git配置为:

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'

无需配置 https.proxy : 查看全文

登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆