# Cannot add certain packages (proxy error)

**URL:** <https://discourse.julialang.org/t/cannot-add-certain-packages-proxy-error/29940>\
**Category:** General Usage\
**Tags:** pkg\
**Created:** [October 15, 2019, 1:42pm UTC](https://discourse.julialang.org/t/cannot-add-certain-packages-proxy-error/29940 "2019-10-15T13:42:50Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![philipp\_polterauer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/philipp_polterauer/32/11393_2.png) [@philipp\_polterauer](https://discourse.julialang.org/u/philipp_polterauer)\
**Post date:** [October 16, 2019, 11:20am UTC](https://discourse.julialang.org/t/cannot-add-certain-packages-proxy-error/29940/2 "2019-10-16T11:20:05Z")

</div>

Hallo Mikolas,

i had a similiar issue, i fixed it through patching BinaryProvider.jl (file PlatformEngines.jl starting line 248)

```julia
@static if Sys.iswindows()
        # For download engines, we will most likely want to use powershell.
        # Let's generate a functor to return the necessary powershell magics
        # to download a file, given a path to the powershell executable
        psh_download = (psh_path) -> begin
            return (url, path) -> begin
                webclient_code = """
                [System.Net.ServicePointManager]::SecurityProtocol =
                    [System.Net.SecurityProtocolType]::Tls12;
                \$webclient = (New-Object System.Net.Webclient);
                \$webclient.Proxy=[System.Net.WebProxy]::GetDefaultProxy();
                \$webclient.Proxy.Credentials=[net.credentialcache]::defaultcredentials;
                \$webclient.Headers.Add("user-agent", "$agent");
                \$webclient.DownloadFile("$url", "$path")
                """
                replace(webclient_code, "\n" => " ")
                return `$psh_path -NoProfile -Command "$webclient_code"`
            end
        end

```

The important lines are

```julia
 \$webclient.Proxy=[System.Net.WebProxy]::GetDefaultProxy();
 \$webclient.Proxy.Credentials=[net.credentialcache]::defaultcredentials;

```

this way BinaryProvider can access files through the proxy.

Hope it helps

Philipp

---

_[View the full topic](https://discourse.julialang.org/t/cannot-add-certain-packages-proxy-error/29940)._
