GithubHelp home page GithubHelp logo

Comments (5)

GoogleCodeExporter avatar GoogleCodeExporter commented on September 2, 2024
To clarify further, my bluetooth service does not have the ability to set a 
proxy.

Original comment by [email protected] on 9 Aug 2013 at 7:22

from proxy-vole.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 2, 2024
Please see https://code.google.com/p/proxy-vole/issues/detail?id=42

I'm also looking for a solution.

Original comment by [email protected] on 14 Nov 2013 at 8:05

from proxy-vole.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 2, 2024
After a ton of Google searching I came across this:

route get 0.0.0.0 2>/dev/null | awk '/interface: / {print $2}'

This is a terminal call that will return the name of the currently active 
network interface (eg. en0)

This should be baked into proxy-vole and used to map against the service orders 
rather than assuming the first service order is the active interface.

Original comment by [email protected] on 14 Nov 2013 at 8:12

from proxy-vole.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 2, 2024
This modified OsxProxySearchStrategy#getProxySelector() method should also 
solve the problem:

    public ProxySelector getProxySelector() throws ProxyException {

           Logger.log(getClass(), LogLevel.TRACE, "Detecting OSX proxy settings");

           // First create a list of Ethernet interfaces that are connected
           List<String> acceptedInterfaces = new ArrayList<String>();
           try {
              Enumeration<NetworkInterface> interfaces = NetworkInterface.getNetworkInterfaces();
              for (Iterator<NetworkInterface> it = Collections.list(interfaces).iterator(); it.hasNext();) {
                 NetworkInterface ni = it.next();
                 if (ni.isLoopback() || ni.isPointToPoint() || ni.isVirtual() || !ni.isUp()) {
                    // Ignore
                    continue;
                 }
                 acceptedInterfaces.add(ni.getName());
              }
           } catch (SocketException ex) {
                 throw new ProxyException("Error getting the Network Interfaces");
           }

           if (acceptedInterfaces.isEmpty()) {
                 throw new ProxyException("No acceptable Network Interfaces found");
           }

           // Now look at the Network Settings
           try {
              Dict settings = PListParser.load(getSettingsFile());
              Object currentSet = settings.getAtPath("/CurrentSet");
              if (currentSet == null) {
                 throw new ProxyException("CurrentSet not defined");
              }

              Dict networkSet = (Dict) settings.getAtPath(String.valueOf(currentSet));
              List<?> serviceOrder = (List<?>) networkSet.getAtPath("/Network/Global/IPv4/ServiceOrder");
              if (serviceOrder == null || serviceOrder.size() == 0) {
                 throw new ProxyException("ServiceOrder not defined");
              }

              // Look at the Services in priority order and pick the first one that was
              // also accepted above
              Dict proxySettings = null;
              for (int i = 0; i < serviceOrder.size(); i++) {
                 Object candidateService = serviceOrder.get(i);
                 Object networkService = networkSet.getAtPath("/Network/Service/"+candidateService+"/__LINK__");
                 if (networkService == null ) {
                    throw new ProxyException("NetworkService not defined.");
                 }
                 Dict selectedServiceSettings = (Dict) settings.getAtPath(""+networkService);
                 String interfaceName = (String) selectedServiceSettings.getAtPath("/Interface/DeviceName");
                 if (acceptedInterfaces.contains(interfaceName)) {
                    Logger.log(getClass(), LogLevel.TRACE, "Looking up proxies for device " + interfaceName);
                    proxySettings = (Dict) selectedServiceSettings.getAtPath("/Proxies");
                    break;
                 }
              }
              if (proxySettings == null) {
                 throw new ProxyException("No Ethernet service found");
              }


              ProtocolDispatchSelector ps = new ProtocolDispatchSelector();
              installSelectorForProtocol(proxySettings, ps, "HTTP");
              installSelectorForProtocol(proxySettings, ps, "HTTPS");
              installSelectorForProtocol(proxySettings, ps, "FTP");
              installSelectorForProtocol(proxySettings, ps, "Gopher");
              installSelectorForProtocol(proxySettings, ps, "RTSP");
              installSocksProxy(proxySettings, ps);

              ProxySelector result = ps;
              result = installPacProxyIfAvailable(proxySettings, result);
              result = autodetectProxyIfAvailable(proxySettings, result);

              result = installExceptionList(proxySettings, result);
              result = installSimpleHostFilter(proxySettings, result);
              return result;
           } catch (XmlParseException e) {
              throw new ProxyException(e);
           } catch (IOException e) {
              throw new ProxyException(e);
           }
    }



Original comment by [email protected] on 14 Nov 2013 at 11:07

from proxy-vole.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 2, 2024
Hi all,
Finally I found the time (and an OSX laptop) to fix this issue. I integrated a 
solution based on the fix of "hansbergstengtalk". Thanks for submitting this.

The fix is in the repository checked in with revision 117.

I will release it with a new version of proxy vole within this week.

Please note that in the OSX Network Settings there is a little known feature to 
change the order of the interfaces. So you might want to sort your WLAN 
interface to the top. This could also help for other applications that fetch 
the wrong interface.

But with the new release this should be no longer necessary.

Have fun,
- Rossi

Original comment by [email protected] on 4 Dec 2013 at 12:27

  • 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.