Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support proxy in netstandard #2738

Merged
merged 1 commit into from
Sep 17, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/Paket.Core/Common/Utils.fs
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,16 @@ let envProxies () =
match Uri.TryCreate(envVarValue, UriKind.Absolute) with
| true, envUri ->
#if NETSTANDARD1_6
raise <| System.NotImplementedException ("I don't know how WebProxy can should be replace in dotnetcore. Therefore this is currently not supported. Please implement me :)")
Some
{ new IWebProxy with
member __.Credentials
with get () = (Option.toObj <| getCredentials envUri) :> ICredentials
and set value = ()
member __.GetProxy _ =
Uri (sprintf "http://%s:%d" envUri.Host envUri.Port)
member __.IsBypassed (host : Uri) =
Array.contains (string host) bypassList
}
#else
let proxy = WebProxy (Uri (sprintf "http://%s:%d" envUri.Host envUri.Port))
proxy.Credentials <- Option.toObj <| getCredentials envUri
Expand Down