Skip to content

Instantly share code, notes, and snippets.

@f-bader
Last active July 30, 2018 11:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save f-bader/b3cecc2fcda28be231450d440a576641 to your computer and use it in GitHub Desktop.
Save f-bader/b3cecc2fcda28be231450d440a576641 to your computer and use it in GitHub Desktop.
Proxy, proxy on the wall
<configuration>
<system.net>
<defaultProxy>
<proxy usesystemdefault="false" autoDetect="false" proxyaddress="http://myproxy.local.bader.cloud:3128" bypassonlocal="true"/>
<bypasslist>
<add address="[a-z]+\.local\.bader\.cloud$" />
</bypasslist>
</defaultProxy>
</system.net>
</configuration>
git config --global http.proxy http://myproxy.local.bader.cloud:3128
# Install Chocolatey through a proxy
$env:chocolateyProxyLocation = "http://myproxy.local.bader.cloud:3128"
$proxy = new-object System.Net.WebProxy
$proxy.Address = $env:chocolateyProxyLocation
$wc = New-Object System.Net.WebClient
$wc.proxy = $proxy
iex ($wc.DownloadString('https://chocolatey.org/install.ps1'))
# Set Proxy for package download
choco config set proxy $env:chocolateyProxyLocation
$proxyString = "http://myproxy.local.bader.cloud:3128"
$proxyUri = new-object System.Uri($proxyString)
[System.Net.WebRequest]::DefaultWebProxy = new-object System.Net.WebProxy ($proxyUri, $true)
$proxy = "http://myproxy.local.bader.cloud:3128"
Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force -Proxy $proxy
Register-PSRepository -Default -InstallationPolicy Trusted -Proxy $proxy
netsh winhttp set proxy "myproxy.local.bader.cloud:3128" bypass-list="*.local.bader.cloud;<local>"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment