Git Product home page Git Product logo

Comments (4)

bezzad avatar bezzad commented on May 18, 2024

Please try the below way in a new console application and see you can do it or not?

HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(Url);
request.AllowAutoRedirect = true;
WebProxy myProxy = new WebProxy("www.myserver.com/proxy/can.pac", true);
myProxy.Credentials = new NetworkCredential("user", "password");
request.Proxy = myProxy;
HttpWebResponse response = (HttpWebResponse)Request.GetResponse();

Thanks.

from downloader.

ghost1372 avatar ghost1372 commented on May 18, 2024

now i get this error

System.Net.WebException: 'The remote server returned an error: (421) Misdirected Request.'

this is my pac url
http://raw.githubusercontent.com/ghost1372/HandySub/master/Proxy/can.pac
if you set in internet options you can access youtube and other websites
image

but I found that any program created with .NET Core suffers from these problems and errors. There are no problems with the .NET Framework

from downloader.

bezzad avatar bezzad commented on May 18, 2024

This is a .NET issue and no related to the Downloader library. Because I try to use this proxy with HttpClient or HttpWebRequest in .Net Core and get some errors.
I tried the below options in Downloader or HttpClient or pure HttpWebRequest:

Proxy = new WebProxy() {
    Address = new Uri("https://raw.githubusercontent.com/ghost1372/HandySub/master/Proxy/can.pac"),
    UseDefaultCredentials = false,
    Credentials = System.Net.CredentialCache.DefaultNetworkCredentials,
    BypassProxyOnLocal = true
}

So the httpClient get an error: System.NotSupportedException: Only the 'http' scheme is allowed for proxies.
I search this error and seem this issue is from .NET Core and many browsers only support http proxies, https proxies are not yet widely supported.
Please see Unable to connect to HTTPS endpoint through WebProxy issue of .NET Core.

Note: your proxy address is not real http and redirected on https and if you set the http on the proxy address you get an error:
The remote server returned an error: (404) Not Found.
Please test your proxy address on HttpClient or HttpWebRequest and if that has no issue so the downloader must be working correctly.

from downloader.

ghost1372 avatar ghost1372 commented on May 18, 2024

This is a .NET issue and no related to the Downloader library. Because I try to use this proxy with HttpClient or HttpWebRequest in .Net Core and get some errors.
I tried the below options in Downloader or HttpClient or pure HttpWebRequest:

Proxy = new WebProxy() {
    Address = new Uri("https://raw.githubusercontent.com/ghost1372/HandySub/master/Proxy/can.pac"),
    UseDefaultCredentials = false,
    Credentials = System.Net.CredentialCache.DefaultNetworkCredentials,
    BypassProxyOnLocal = true
}

So the httpClient get an error: System.NotSupportedException: Only the 'http' scheme is allowed for proxies.
I search this error and seem this issue is from .NET Core and many browsers only support http proxies, https proxies are not yet widely supported.
Please see Unable to connect to HTTPS endpoint through WebProxy issue of .NET Core.

Note: your proxy address is not real http and redirected on https and if you set the http on the proxy address you get an error:
The remote server returned an error: (404) Not Found.
Please test your proxy address on HttpClient or HttpWebRequest and if that has no issue so the downloader must be working correctly.

Yes, unfortunately, the problem is with .NET Core, anyway, thank you.

from downloader.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.