Proxy support #1
Comments
fixed in 63cf4e0 |
I am having an error while installing one of the packages A positional parameter cannot be found that accepts argument 'proxy.company.private:8080' |
Which package are you seeing this with? Or is it any package? |
the chocolatey version is 0.9.8.11 and I was installing nodejs. But not only installing nodejs |
do you guys have a proxy in place? Someone else reported issues with the proxy code that we took from a patch. If you go to C:\NuGet\chocolateyInstall\helpers\chocolateyInstaller.psm1 and comment out lines 499-507: if (!$webclient.Proxy.IsBypassed($url))
{
$cred = get-credential
$proxyaddress = $webclient.Proxy.GetProxy($url).Authority
Write-host "Using this proxyserver: " $proxyaddress
$proxy = New-Object System.Net.WebProxy($proxyaddress)
$proxy.credentials = $cred.GetNetworkCredential();
$req.proxy = $proxy
} to be # if (!$webclient.Proxy.IsBypassed($url))
# {
# $cred = get-credential
# $proxyaddress = $webclient.Proxy.GetProxy($url).Authority
# Write-host "Using this proxyserver: " $proxyaddress
# $proxy = New-Object System.Net.WebProxy($proxyaddress)
# $proxy.credentials = $cred.GetNetworkCredential();
# $req.proxy = $proxy
# } Then tell me what you see. |
Attempting to install not (cinst nodejs) With those lines commented out I get... Downloading nodejs (http://nodejs.org/dist/v0.6.0/node.exe) to C:\NuGet\lib\nodejs.0.6.0\tools\node.exe [ERROR] nodejs did not finish successfully. Boo to the chocolatey gods![ERROR] Exception calling "GetResponse" with "0" argument(s): "The remote server returned an error: (407) Proxy Authentication Required."Without them commented out I get... Downloading nodejs (http://nodejs.org/dist/v0.6.0/node.exe) to C:\NuGet\lib\nodejs.0.6.0\tools\node.exe [ERROR] nodejs did not finish successfully. Boo to the chocolatey gods![ERROR] A positional parameter cannot be found that accepts argument '10.0.100.2:8080'.I do have a proxy in place and the argument it is complaining about is it. Without those lines commented it requests my credentials. |
We need better proxy support. :( |
FWIW, this seemed to work for me: if (!$webclient.Proxy.IsBypassed($url))
{
#$cred = get-credential
$proxyaddress = $webclient.Proxy.GetProxy($url).Authority
Write-host "Using this proxyserver: $proxyaddress"
#$proxy = New-Object System.Net.WebProxy($proxyaddress)
#$proxy.credentials = $cred.GetNetworkCredential();
#$req.proxy = $proxy
$req.proxy.credentials = [System.Net.CredentialCache]::DefaultCredentials;
} |
Fixing this again for the first time, for the last time? ;) |
Hopefully this is fixed with the latest bits coming in 0.9.8.17. If not we will add a config value to specify your proxy type. |
Almost all packages are not working inside of our auth proxy with Chocolatey 0.9.8.20 |
Working with Chocolatey v0.9.8.23, #if (!$webclient.Proxy.IsBypassed($url))
#{
# $creds = [net.CredentialCache]::DefaultCredentials
# if ($creds -eq $null) {
# Write-Debug "Default credentials were null. Attempting backup method"
# $cred = get-credential
# $creds = $cred.GetNetworkCredential();
# }
# $proxyaddress = $webclient.Proxy.GetProxy($url).Authority
# Write-host "Using this proxyserver: $proxyaddress"
# $proxy = New-Object System.Net.WebProxy($proxyaddress)
# $proxy.credentials = $creds
# $req.proxy = $proxy
#}
if (!$webclient.Proxy.IsBypassed($url))
{
$proxyaddress = $webclient.Proxy.GetProxy($url).Authority
Write-host "Using this proxyserver: $proxyaddress"
$req.proxy.credentials = [net.CredentialCache]::DefaultCredentials
} |
I'm thinking we'll want to do some configuration file stuff for proxies since there seems to be different ways of handling the way in |
@grenade would you file a new issue? |
original: ferventcoder/nugetpackages#29
http://www.streamline-it-solutions.co.uk/blog/post/Getting-through-a-proxy-server-with-PowerShell.aspx
The text was updated successfully, but these errors were encountered: