我需要从命令行发出HTTP请求,但我支持最前线的TMG代理。环境变量http_proxy无法工作。
我仍然会发现错误:
ERROR 407: Proxy Authentication Required ( Forefront TMG requires authorization to fulfill the request. Access to the Web Proxy filter is denied. ).我在这台PC上没有GUI (no X)。
我如何提出一个简单的http请求并绕过这个代理?
发布于 2013-08-22 13:56:41
要使用wget进行身份验证,可以使用:
wget --proxy-user=user --proxy-password=pass http//someurl.com/file如果要将其设置为配置文件中的变量,请使用:
export http_proxy="http://username:password@proxy.domain:8080"这些是你所需要的。当然,您应该有一个用户名:这个代理的密码。
您可以将最后一行添加到~/.bashrc或~/.profile或任何在启动提示符时执行的脚本中。如果您只想让wget知道这一点,您应该修改~/.wgetrc (仅针对用户)或/etc/wgetrc (对于所有用户),并添加:
proxy_password = pass
proxy_user = userhttps://askubuntu.com/questions/335828
复制相似问题