如何为http代理设置鱿鱼并让git使用它?

问题描述 投票:2回答:1

简介我有一个http代理,其中有一个不寻常的密码,其中带有“ @”。我不能改变我必须仅使用代理进行连接,即每个软件都必须使用代理,否则它们将无法工作。

现状我使用Ubuntu 16.04。我已经用用户名和密码设置了gnome settings代理。我已经设置了/etc/environment文件来指定http代理。我已经单独设置了apt以使用代理设置。

以上所有配置都有一个共同点,'@'未被直接接受,我不得不使用%40对其进行转义。要通过终端传递代理用户名,密码,地址和端口,我必须使用http://username:password@server:port。这里出现问题,因为大多数软件在我用@写入密码时都会感到困惑。类似于pass@word

git问题Link to how to make git work with http proxy我将~/.gitconf文件设置如下:

全部都不起作用。


我在朋友的macOS Sierra中使用squidman

来设置父代理,并将git的代理设置为使用squidman正在侦听且git工作的端口。

为了复制相同的行为,我在Ubuntu 16.04中安装了squid。我已将squid.conf文件设置如下:

http_port 3128
cache_peer server parent port 0 no-query no-digest login=user:pass%%40word      
#as specified by squid config rules in comments

并将git proxy设置为

[http]
    proxy = localhost:3128

仍然让我无法连接到服务器

问题

如何正确设置Squid代理?
My details for proxy are like (they are invariants):
    Username: user
    Password: pass@54321
    Server: 192.25.5.6 //The server is in my network
    Port: 808

如何使用git使用squid的代理?


参考不是必需的,但将非常有帮助。

简介,我有一个http代理,它的密码不寻常,带有'@'。我不能改变我必须仅使用代理进行连接,即每个软件都必须使用代理,否则它们将无法工作。 ...

git proxy http-proxy squid
1个回答
0
投票

git config文件名为“ .gitconfig”,而不是您在问题中提到的“ .gitconf”。这可能就是为什么您的设置无法按预期进行的原因

© www.soinside.com 2019 - 2024. All rights reserved.