Set SOCKS proxy for Safari

4

Is it possible to specify the SOCKS proxy for Safari in OS X Lion?

I've got an address and port number I have to fill in there but I can't find the settings in the browser...

Open the way

Posted 2011-11-01T17:32:20.600

Reputation: 6 061

Answers

5

No. It is only possible to set the system-wide proxy for a specific connection in System Preferences » Network » (select a connection) » Advanced… » Proxies.

enter image description here


Which is where you are sent when you access Safari » Preferences… » Advanced » Proxies.

enter image description here

Daniel Beck

Posted 2011-11-01T17:32:20.600

Reputation: 98 421

@JasonS Use case for being able to set Safari proxy alone: Safari for video (i.e. US NetFlix, etc.) as its video processing is efficient, but Chrome is my regular main browser (no need to appear from US) with its much better cross-browser sharing of bookmarks/passwords/history/tabs across devices. Sending traffic to route through (paid) proxy when not needed seems wasteful, slower and inefficient. – Baker – 2015-10-23T11:41:41.140

@Baker, Ok I can see your use case, but I was responding to @flow who says this is 'stupid'. The are other use cases as I outlined where central configuration makes a lot of sense and saves time. In another post by @tr3buchet, he recommends using 'a real browser'. These are just rants. By that definition Chrome is also not a 'real browser', since it uses the system proxy settings. There are a number of options for your case such as using a .pac file to proxy certain sites, or a streaming proxy, or Firefox can use its own proxy settings or the system settings. – Jason S – 2015-10-24T23:00:29.800

@JeffBurdges On OS X, you can configure different applications / user agents to use a particular proxy, or none, through a .pac file. I don't find this to be a flaw in OS X. On the contrary I find that OS X has had the capability to configure network profiles for many years now. I have not used Windows since Win 7 (I can't speak for > 7), but Win 7 & prior did not support switching between multiple network profiles. A number of makers (eg Lenovo), included utilities to do this, but I feel it is a fault of the OS to not provide it. OS X does not suffer this fault, but some OS do. – Jason S – 2015-10-25T00:15:33.860

@JasonS I'm now checking http://findproxyforurl.com/example-pac-file/ for details on how to setup a .pac file that can intelligently proxy requests based on domain requested. Initial tries failed, but I'll continue to investigate & test. Thanks for the constructive response.

– Baker – 2015-10-25T15:41:52.523

@Baker I have a proxy.pac that returns PROXY XXX or DIRECT based on user agent. It's a Python CGI script that spits out the JavaScript. – wbg – 2016-07-19T06:27:13.630

It is possible to have multiple settings: You configure them as separate "Locations". Unfortunately, these are still system-wide and affect all tools using the System Network configuration selected for that location. I have secured remote access to some of my web apps by only allowing local access (localhost), and to access I configure my browser with a SOCKS proxy I have setup locally on my workstation (ssh -D 1080). Hence the need of being able to do that at an application level. Also unfortunately that I do not get this to work with Safari (only works on FireFox). – YoYo – 2016-12-13T00:16:31.983

this is stupid, since in firefox I can do this without problem. what I wanted to say is if using safari can be hacked for this purpose – Open the way – 2011-11-01T19:07:52.073

1@flow Firefox is a cross-platform program and probably not even capable of using the system-wide proxy. As should be obvious from the integration of the Network preference pane into Safari's own options, there just is no separate proxy configuration for Safari. – Daniel Beck – 2011-11-01T19:29:39.797

SOCKS proxies are commonly used to provide different proxies for different processes. It's clearly a flaw in Mac OS X if you cannot easily do this. – Jeff Burdges – 2012-04-04T17:26:55.300

1@flow How is this stupid? What use case do you have to configure Safari separately? In fact I find this greatly convenient. Any application that uses the system network settings, will be able to use any proxy you set. And you can configure multiple network profiles with different proxies and switch between them easily, instead of configuring each application (which could be 5 or 10), each time you switch connections (which could be at least twice per day, eg between work, home, school). – Jason S – 2014-02-12T19:20:09.190

1

Try networksetup -setwebproxy

usage : networksetup -setwebproxy "Your service name" domain port authentication(on/off) username password

e.g :

networksetup -setwebproxy "Wi-Fi" localhost 8000 off

The protocol defaults to http, you would have to specify socks:// Username and password only need to be set if your authentication is on.

Pavan G

Posted 2011-11-01T17:32:20.600

Reputation: 11

0

There's also MacProxy to get system-wide network proxy support!

jaffo

Posted 2011-11-01T17:32:20.600

Reputation: 1

2Can you maybe elaborate a bit on how it works? – slhck – 2011-11-03T11:55:10.757