7

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?

hanxue
  • 3,134
bdf0506
  • 71

2 Answers2

5

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>'

Dan R
  • 103
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
  • 161