GithubHelp home page GithubHelp logo

Comments (11)

erosman avatar erosman commented on June 30, 2024
  • Which version of FoxyProxy Basic are you using?
  • How are you accessing the localhost services?

Firefox should bypass proxy for localhost. 🤔

Firefox ☰ ➜ Settings ➜ General ➜ Network Settings ➜ Settings

Connections to localhost, 127.0.0.1/8, and ::1 are never proxied.

from browser-extension.

muelli avatar muelli commented on June 30, 2024

Edition: FoxyProxy Basic
Version: 7.5.1

I am typing localhost:8383 into the address bar and I see it doesn't connect. When I select "turn Foxyproxy off", then I can connect.

from browser-extension.

erosman avatar erosman commented on June 30, 2024

In that case, it appears that the Firefox proxy.onRequest bypasses the localhost restrictions.

FoxyProxy v8.0 already has Global Exclude feature which can be used (once it is released).
Please wait for FoxyProxy v8.0.

image

from browser-extension.

muelli avatar muelli commented on June 30, 2024

In that case, it appears that the Firefox proxy.onRequest bypasses the localhost restrictions.

that sounds like a bug in Firefox then, I suppose.
Do you think it's worth following up with them?

from browser-extension.

erosman avatar erosman commented on June 30, 2024

TBH, proxy.onRequest is an independent process. That is probably why it is not taking into account the settings set in Network settings which is a totally different process.

I am going to ask Mozilla engineers about it.

from browser-extension.

jackyzy823 avatar jackyzy823 commented on June 30, 2024

I don't think that's Firefox's bug.

In Foxy version 7.5.1,
If you set Foxy to "use patterns with enabled proxy by patterns and order" , the Option "Do not use for localhost and intranet/private IP addresses" is taken into consideration.
Ref: https://github.com/foxyproxy/firefox-extension/blob/master/src/scripts/matcher.js#L20-L40

If you set Foxy to use the specific proxy , then Foxy will always use the proxy.
Ref: https://github.com/foxyproxy/firefox-extension/blob/a3598e1c7f0237ee50e8a13a59dec265462c38a6/src/scripts/matcher.js#L65

from browser-extension.

erosman avatar erosman commented on June 30, 2024

@jackyzy823 Thank you for looking into the issue.

The query posted to matrix was a general one.

If a proxy is set in Firefox, localhost will not be proxied.

Firefox ☰ ➜ Settings ➜ General ➜ Network Settings ➜ Connection Settings

Connections to localhost, 127.0.0.1/8, and ::1 are never proxied.

However, if a proxy is set via proxy.onRequest, it is reported that the localhost is proxied. i.e.
Firefox -> Proxy-server -> localhost

I can not test that currently with my set-up but if that is the case, it would not only be undesirable, but also a security concern.
Can that be confirmed?

The query is about the Firefox process and the FoxyProxy code should be irrelevant. e.g.

Normal proxy connection: Firefox -> proxy -> target
For localhost: Firefox -> disregard-proxy -> localhost

https://searchfox.org/mozilla-central/source/toolkit/system/windowsproxy/nsWindowsSystemProxySettings.cpp#127-134

        // Don't use proxy for local hosts (plain hostname, no dots)
        if (!isIpAddr && !host.Contains('.')) {
          return true;
        }

        if (host.EqualsLiteral("127.0.0.1") || host.EqualsLiteral("::1")) {
          return true;
        }

https://searchfox.org/mozilla-central/source/netwerk/test/gtest/TestProtocolProxyService.cpp#26-37

auto CheckLoopbackURLs = [&](bool expected) {
    // loopback IPs are always filtered
    spec = "http://127.0.0.1/";
    ASSERT_EQ(NS_NewURI(getter_AddRefs(url), spec), NS_OK);
    ASSERT_EQ(pps->CanUseProxy(url, 80), expected);
    spec = "http://[::1]/";
    ASSERT_EQ(NS_NewURI(getter_AddRefs(url), spec), NS_OK);
    ASSERT_EQ(pps->CanUseProxy(url, 80), expected);
    spec = "http://localhost/";
    ASSERT_EQ(NS_NewURI(getter_AddRefs(url), spec), NS_OK);
    ASSERT_EQ(pps->CanUseProxy(url, 80), expected);
  };

PS. FoxyProxy 8.0 is the most up-to-date, although not released yet.

from browser-extension.

jackyzy823 avatar jackyzy823 commented on June 30, 2024

I think if "proxy add-ons" take over control of Proxy settings, then the settings in Firefox config would not take effect (and also it shouldn't) .

from browser-extension.

erosman avatar erosman commented on June 30, 2024

@jackyzy823
There are 2 main proxying API in Firefox:

Chrome only has proxy.settings.

localhost

  • proxy.settings in both Firefox and Chrome implement a default bypass/pass-through for localhost
  • proxy.onRequest does not appear to have the above default bypass

The question is, should proxy.onRequest have a default bypass/pass-through for localhost or not?

from browser-extension.

erosman avatar erosman commented on June 30, 2024

For the time being, a default bypass/past-through for localhost is added to the FoxyProxy v8.0.

from browser-extension.

erosman avatar erosman commented on June 30, 2024

See also:
Bug 1854324: proxy.onRequest failure to bypass proxy for localhost

from browser-extension.

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.