Google chrome ignorning localhost for SOCKS5 proxy

5

I am utilizing Google Chrome as a port forward via SOCKS proxy.

Essentially I am running the following command via terminal: ssh foo@bar.com -D 9999

Then in Google Chrome, I set the SOCKS proxy to 127.0.0.1:9999.

Problem is, I need to then access the host of https://localhost/foo/bar to be able to access what I need to access. This works fine on Firefox (when I modify the proxy settings), but not on Chrome.

If I go into /etc/hosts on my system and create an entry like this:

127.0.0.1 foobar

I can then go to https://foobar/foo/bar and everything works fine. It seems that chrome refuses to forward localhost or 127.0.0.1. Is there any way around this?

bdf0506

Posted 2019-05-25T14:27:48.783

Reputation: 51

A similar question is here, with similar suggested workarounds. – Dan R – 2019-08-29T04:01:52.013

Answers

3

By default, Chrome 72+ will NOT send localhost requests through your configured proxy.

You need to configure Chrome's proxy bypass list to contain <-loopback>, which is a special option that tells it to send localhost through the proxy.

Via command line, this looks like:

google-chrome --proxy-server=socks://127.0.0.1:9999 --proxy-bypass-list='<-loopback>'

Zach Bloomquist

Posted 2019-05-25T14:27:48.783

Reputation: 131

1

Some more info: The source code has a special case for the exact text string <-loopback>. According to a comment in the source code, the meaning is: Remove the implicitly added bypass rules

– Erik Sjölund – 2020-02-19T17:39:59.983

0

I have similar problem.(but I used SwitchyOmega, didn't know chrome already can use socks in build-in settings). At least, heading for my question could be the same.

Sometimes I use proxy ssh tunnel to access ports which are only acessible from server itself.

But Chrome started to ignore proxy settings for localhost so I had to search for workarounds too.

Currentl solution is to use wildcard dns services. Example links to localhost: http://127.0.0.1.nip.io, http://127.0.0.1.xip.io

quant2016

Posted 2019-05-25T14:27:48.783

Reputation: 1

3Can you explain in some detail what the user needs to do?  Please do not respond in comments; [edit] your answer to make it clearer and more complete. – Scott – 2019-06-25T10:14:08.093