Sometimes when I'm connected to a WiFi, Firefox can't connect to any page saying something about proxy refusing connection.

I'd reconsider using a proxy. Today I think I use a proxy maybe once in some thousand plus locations so you really need to ask why you are using a proxy.