Match only on host portion of URL

Could we have a per-pattern switch that will do the match only the host portion of the URL?

The use case I have in mind is this:

I shunt several non-fully-qualified hostnames through proxy A and let everything else through the default connection. The least-obnoxious way I can find to do this is to send anything that matches the regexp ^http://(foo|bar|baz)/?.*$ to proxy A. This will allow me to visit http://foo, http://foo/, http://foo/index.html, etc. through proxy A. However, if I visit http://foocorp.com, that URL will be incorrectly directed to proxy A, because it matches the regexp that allows me to type just foo into the URL bar, whack the Enter key and go.

Being able to narrow the match to just the host name would allow me to have compact, clean regexps like ^(foo|bar|baz)$ and still have similar-looking outside URLs work properly.

Thanks very much!

Hi,

Hi,

Firstly, you don't need to surround your regular expressions in FoxyProxy with ^ and $. This is in the FAQ. You can if you like, but FoxyProxy will add those symbols internally if you don't do it yourself.

As for your feature request, I am sure you realize you can write more specific regular expressions to prevent http://foocorp.com from going through proxy A, right? If you're afraid of your patterns getting too long, just create multiple patterns all for the same proxy.

Nevertheless, I like your idea and have added it to my list of features to implement. There's a lot I want to do first, though, so don't expect it to come very soon. Feel free to bump this thread in the future if you haven't seen it in a while. To take the idea to the logical extreme, perhaps you should have the ability to match on any URL component (e.g., protocol, path, port, etc., not just the domain. That's obviously not as usual, though :)

Thanks for the idea, and thanks for using FoxyProxy!

Eric