martins
martins

Reputation: 10009

Allow access to localhost from localhost by Squid

I'm running Squid locally and I'd like to access by Ruby server running on localhost:3000 through Squid.

If I try to acces localhost:3000 I get this message:

The following error was encountered while trying to retrieve the URL:
http://localhost:3000/

Access Denied.

Access control configuration prevents your request from being allowed
at this time.

How can I configure Squid to allow access to localhost from localhost? I´ve updated this line from deny to allow: http_access allow to_localhost

Upvotes: 4

Views: 13236

Answers (3)

MarrekNožka
MarrekNožka

Reputation: 443

Must add exception for localhost or 127.0.0.0/8 to direct connect without proxy. For example in Firefox: Preferences -> advanced -> Network -> Settings -> No Proxy for.

OR use envirometn variable no_proxy.

export no_proxy=localhost,127.0.0.0/8

My systemwide settings is in /etc/environment

http_proxy=http://172.16.0.253:3128/
https_proxy=http://172.16.0.253:3128/
no_proxy=localhost,127.0.0.0/8

Upvotes: 3

martins
martins

Reputation: 10009

Perhaps not the most sexy solution, but I solved it by setting up a Ngrok tunell $ ./ngrok http 3128

Now I can access Squid through identifier.ngrok.com

Upvotes: 0

Consec
Consec

Reputation: 679

Go to: SquidMan > Preferences > Template and comment these lines:

#Deny requests to certain unsafe ports
#http_access deny !Safe_ports

#Deny CONNECT to other than secure SSL ports
#http_access deny CONNECT !SSL_ports

alternatively you can whitelist this port in acl port list below these lines.

If this doesn't help make sure you add bypass proxy correctly (localhost or 127.0.0.1) in network > advanced > proxies.

In my case this bypass proxy disappears after every 2-3 minutes. ( and i don't know how to resolve it )

Upvotes: 0

Related Questions