Giter Club home page Giter Club logo

Comments (5)

GoogleCodeExporter avatar GoogleCodeExporter commented on September 2, 2024
I attach one solution

Original comment by [email protected] on 6 Dec 2010 at 7:28

Attachments:

from proxy-vole.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 2, 2024
Hi,
This is known problem. And I do not know about a clear way to solve this.
The file URLs are handled differently and seem not to be clearly specified.
You will have a lot of confusion with this, particularly when you have an UNC 
name encoded in A URL: e.g. \\my_server\path\file.pac
Will give you a URL of this format

file:///my_server/path/file.pac or file:////my_server/path/file.pac

So you never know exactly how many slashes belong to the protocol and how many 
to the  location.

I will review your patch and test it and if all looks good integrate it.
Thanks for reporting this and thanks for taking your time to provide a patch.

Have fun,
- Rossi

Original comment by [email protected] on 11 Dec 2010 at 12:12

  • Changed state: Accepted
  • Added labels: Type-Enhancement
  • Removed labels: Type-Defect

from proxy-vole.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 2, 2024
With IE8 there is also a Problem with reading PAC via HTTP-Protokol. When i do 
the standard way: ProxySelector lcMyProxySelector = 
proxySearch.getProxySelector();
lcMyProxySelector is null. I had to use a workaround:
Win32IESettings ieSettings = new IEProxySearchStrategy().readSettings();
UrlPacScriptSource lcPSS = new 
UrlPacScriptSource(ieSettings.getAutoConfigUrl());
lcMyProxySelector = new PacProxySelector(lcPSS);
Then lcMyProxySelector can be set to default.

Original comment by [email protected] on 26 Aug 2011 at 1:00

from proxy-vole.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 2, 2024
I noticed the same thing. Setting a URL to a pac file in Internet Explorer 9, 
via Internet Options > Connections > LAN Settings > Use automatic 
configurations script:  Expects a file: URL to have 2 slashes like this 
"file://C:/sample.pac"

But when this is parsed inside of IEProxySearchStrategy.createPacSelector the 
URL is unrecognized unless it has the more proper 3 slashes like this: 
"file:///C:/sample.pac"

ERROR: com.btr.proxy.selector.pac.UrlPacScriptSource - File reading error.
ERROR: com.btr.proxy.selector.pac.UrlPacScriptSource - Loading script failed.
ERROR: com.btr.proxy.selector.pac.JavaxPacScriptParser - JS evaluation error.
ERROR: com.btr.proxy.selector.pac.PacProxySelector - PAC resolving error.

Since this is really an IE problem of forcing you to use improperly formatted 
URL's 
http://en.wikipedia.org/wiki/File_URI_scheme

It seems a simple fix would be to patch the IE URL inside of the 
IEProxySearchStrategy class like this...

if (pacUrl != null && pacUrl.trim().length() > 0) {
    Logger.log(getClass(), LogLevel.TRACE, "IE uses script: "+pacUrl);

    // If the IE has a file URL and it only starts has 2 slashes, add a third so 
    // it can be properly converted to the URL class
    if(pacUrl.startsWith("file://") && !pacUrl.startsWith("file:///")) {
        pacUrl = "file:///" + pacUrl.substring(7);
    }

    return new PacProxySelector(new UrlPacScriptSource(pacUrl));
}

I tested the above code and it now works properly for me.

Original comment by [email protected] on 1 Nov 2011 at 11:13

from proxy-vole.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 2, 2024
Hi,
I really like your fix proposal. It is local to the IE code and will align the 
URLs to the common format.
I integrated this in the repository and also made a new release containing this.

Thanks for the good proposal,
- Rossi

Original comment by [email protected] on 2 Nov 2011 at 9:23

  • Changed state: Fixed

from proxy-vole.

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.