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

Add basic proxy support for NuGet API V3 #620

Merged
merged 4 commits into from
Feb 10, 2024

Conversation

k6a
Copy link
Contributor

@k6a k6a commented Jan 28, 2024

The default proxy setup was missing in HttpClient/HttpClientHander initializaion.
By adding WebRequest.DefaultWebProxy client will look for HTTP_PROXY, NO_PROXY environment variables if it exists.

Tested on Unity 2018.3.0, 2022.3.18, and Squid 5.7.

* addresses proxy connection issue GlitchEnzo#495
@JoC0de
Copy link
Collaborator

JoC0de commented Jan 30, 2024

Are you sure it didn't work as it was before? As far as I understand the documentation https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httpclienthandler.proxy?view=net-8.0 it is the default behavior.

@k6a
Copy link
Contributor Author

k6a commented Feb 2, 2024

@JoC0de Thanks for your response!

I just got started using this great plugin in about a week ago. Still figuring out how to use it in corporate proxy (harsh) environment.

Further tested and found that the symptom only occurs on Windows + (corporate) proxy enabled environment.

On MacOS, it works just fine (without the fix).

The documentation you mentioned explains the behaviour of HttpClientHandler on .NET runtime.

Since the Unity Editor runs on Mono runtime, internal structures and behaviours are slightly different than that of .NET runtime.

Reference source for both runtimes:

.NET:

Mono:

And yes, .NET does setup system proxy on initialization whereas Mono doesn't.

@JoC0de JoC0de merged commit 0d302f6 into GlitchEnzo:master Feb 10, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants