SOCKS Proxy keeps re-enabling at every startup - posted in Mac OS: A MacBook Pro I was working with started having a problem where Internet access suddenly stopped working. After looking through. At startup I find the option configure the Socks Proxy checked and, as a consequence, my internet connection (especially in the case of Mail) does not work or, at the best, is extremely low for a couple of minutes and then goes off. I uncheck the notion and all works fine. However, at a new startup I find the option checked again. When you configure a proxy server on your Mac, applications will send their network traffic through the proxy server before going to their destination. This may be required by your employer to bypass a firewall, or you may want to use a proxy to bypass geoblocking. On random Mac OS devices running Mojave (any version): SOCKS proxy is automatically re-enabled after every reboot/power cycle. By default, no proxy settings should be configured. The proxy is configured with: localhost port 8080 This causes all email apps to go offline intermittently. I like to surf securely and privately via a SOCKS proxy which I created via SSH tunneling, on the Mac. I used the SSH client on my Mac to achieve this. Then I thought, since the iPhone OS is essentially Mac OS, the same trick might work also on the iPhone.
Step-by-Step: Using BlueStacks AppPlayer From Behind a Proxy
Last revision: 15.05.2019
Edelweiss app for mac. Introduction
BlueStacks AppPlayer is a software that brings Android applications to PCs and Mac. This tutorial will show you how to use BlueStacks from behind an HTTP proxy.
A regular HTTP proxy is sufficient to provide access to the internet to BlueStacks itself and to the most of Android apps. A small amount of Android apps use network protocols other than HTTP and HTTPS. In order to proxify these latter apps, you will need a SOCKS, Shadowsocks or SSH proxy server instead.
The instructions below should apply to Mac OS X too as the setup procedure is very similar.
This tutorial has been written for BlueStacks 4. If you determine that this tutorial is outdated, then please feel free to let us know by sending an email via our contact form.
Installation
Download and install ProxyCap. Restart your system when the setup program asks you to do so.
If you already have BlueStacks installed, skip to the next step. Otherwise, download the BlueStacks installer, then run it and follow instructions to install BlueStacks.
![Mac Socks Proxy App Mac Socks Proxy App](/uploads/1/3/4/0/134043795/598428918.png)
Removing proxy set using HD-ConfigHttpProxy
Mac Socks Proxy Automatic Localhost
BlueStacks comes with a command line tool named HD-ConfigHttpProxy.exe which allows users to set a HTTP proxy in BlueStacks. But after using this tool the most Android apps, including Google Play Store, are still unable to connect to the internet.
If you have not set your proxy using HD-ConfigHttpProxy, skip to the next step. If you did, you must remove the proxy before using ProxyCap. Do that by running the following command from the Windows command prompt:
HD-ConfigHttpProxy.exe reset
Configure ProxyCap to work with BlueStacks (Typical Configuration)
We must define 2 separate proxy servers: HTTP and HTTPS. First let's add the HTTP proxy.
Right click on the ProxyCap taskbar icon and choose Configuration.
Click the Proxies category.
Press the New button on the toolbar.
Press the New button on the toolbar.
Select HTTP from the Type drop down list.
Fill in the other settings.
Press the OK button.
Fill in the other settings.
Press the OK button.
Now add the HTTPS proxy. Set the type of the proxy server to HTTPS. The server address and the authorization settings should be the same as for the HTTP proxy.
Now let's create ProxyCap routing rules for BlueStacks. We will add 2 rules: one for the HTTP connections and the other for HTTPS.
Click the Rules category.
Press the New button on the toolbar.
Press the New button on the toolbar.
In the Rule Action section, select the display name of the HTTP proxy server from the drop down list.
In the Program section, click Specify, then click the Browse button.
In the Program section, click Specify, then click the Browse button.
Navigate to the BlueStacks program folder. It is located in Program Files.
Select HD-Player.exe.
Press the Open button.
Select HD-Player.exe.
Press the Open button.
In the Destination Port Range section, click Specify, then type 80 in the first port field.
In the Rule Name section, enter a display name for the rule.
Press the OK button.
In the Rule Name section, enter a display name for the rule.
Press the OK button.
Now add one more 'redirect' rule for HD-Player.exe but with the following changes:
1. In place of the HTTP proxy, specify the HTTPS one.
2. In place of the port 80, specify 443.
1. In place of the HTTP proxy, specify the HTTPS one.
2. In place of the port 80, specify 443.
Click OK to save the configuration.
You are done, run BlueStacks and enjoy!
Configure ProxyCap to work with BlueStacks (Extended Configuration)
The above configuration is sufficient if your system uses a proxy server to connect to the internet. Besides HD-Player.exe, there are 2 other BlueStacks program files (HD-Agent.exe and Bluestacks.exe) that require an internet access, but, unlike HD-Player.exe, they respect the system proxy settings. So this extra configuration step makes sense only if your system does NOT use a proxy server.
Select the first entry in the rule list.
Press the Properties button on the toolbar.
Press the Properties button on the toolbar.
Select the Programs tab.
Add HD-Agent.exe and Bluestacks.exe to the Program list. HD-Agent.exe resides in the same folder as HD-Player.exe. Bluestacks.exe is located in the Client subfoder of the BlueStacks program data folder (C:ProgramDataBlueStacksClient). The Windows ProgramData folder is hidden by default. To open this folder in the Select Proxy dialog box, enter its path (C:ProgramData) in the address bar at the top of the dialog box.
Best free music software mac. Press the OK button.
Repeat the procedure above to add HD-Agent.exe and Bluestacks.exe to the Program list in the second rule.
Well, I’m here at Reading University and one of the joys of living here in halls is using the wonderful internet connection, shared with many other download-happy students.
As well as the speed being quite variable, there’s also a greater security risk, especially when transmitting passwords over normal, unencrypted HTTP connections. To solve that problem, I SSH into my server, still sitting back at home and tunnel HTTP traffic through the SSH connection.
This creates a SOCKS proxy server on my local machine and I can push the Mac’s traffic through it. It takes a long time and is fiddly, however, to switch the SOCKS proxy on and off from System Preferences, especially when (as in my special case) you can’t use Leopard’s Locations feature.
The AppleScript applications provided below are a quicker solution. Launch the right app, type your password and the proxy is flipped on or off. Nice and simple and much less fiddly than messing around in System Preferences.
Please support this work!
There used to be advertising here, but I no longer feel sure that advertising delivers the best experience and truly reflects the values of this site.
Keeping things running, however, is not without financial cost. If you would like to support the time and effort I have put into my tutorials and writing, please
consider making a donation.
consider making a donation.
Download AppleScripts
If you’re not interested in reading how the solution works, and just want some AppleScript applications that you just launch to flip the proxy on/off, download them here:
Make sure you have the proxy settings saved within System Preferences first. For more information, see the Readme PDF in the download. These AppleScripts support only Mac OS X 10.5 Leopard and above.
The Problem
If you’re still here, you’re probably interested in either why I’m doing this or how the solution works. Read on.
For web browsing, I can use Firefox and set its individual proxy settings to use SOCKS without affecting the whole system. That works great, for that unencrypted HTTP stuff.
However, there is also an issue with sending email to SMTP servers on this connection, which prompted me to make this quick-switch solution. I can’t be sure whether the SMTP issue deliberate, or just slowness, but trying to connect to non-Reading SMTP servers to send emails just times out. Therefore, to send emails, I need to tunnel Mail.app’s traffic through the SSH connection too, if only briefly.
Mail.app requires me to change (albeit briefly) the whole system’s proxy setting. Batch file rename mac.
I thought Leopard’s ‘Location’ feature in Network may allow separate network profiles for proxy and normal, but the problem is switching between them drops the SSH connection in Terminal (and therefore, the local SOCKS proxy is no longer running, so the whole thing goes down).
Instead, I need a way to toggle the network SOCKS proxy settings in an automated manner for the system, so I can one-click to flip it on and off again to send an email.
The Solution
Thankfully, Mac OS X’s network settings can be changed via the command line, which in turn can be run from AppleScript. This solution is only tested on Leopard, however it may work on Tiger if references to networksetup are changed as per this article.
Mac Socks Proxy App Download
Here’s how:
$ networksetup -setsocksfirewallproxy Ethernet 127.0.0.1 1080 off
There are four arguments I’ve used here, let me explain what they each do.
-setsocksfirewallproxy – tells networksetup to turn the proxy on, with the following settings
Ethernet – the identifier of the network service to change the settings for (e.g. AirPort, Ethernet). Use networksetup -listallnetworkservices to see all valid values.
127.0.0.1 – the address of the SOCKS proxy. In our case, SSH creates the proxy on the local system, so 127.0.0.1.
1080 – the port of the SOCKS proxy. This is the -D argument in your SSH command.
off – this is for authentication. The SSH SOCKS system doesn’t need authentication and only runs on loopback, so we leave it off. If you’re using a different SOCKS system, you may need this (and also give the username and password as arguments after it).
Ethernet – the identifier of the network service to change the settings for (e.g. AirPort, Ethernet). Use networksetup -listallnetworkservices to see all valid values.
127.0.0.1 – the address of the SOCKS proxy. In our case, SSH creates the proxy on the local system, so 127.0.0.1.
1080 – the port of the SOCKS proxy. This is the -D argument in your SSH command.
off – this is for authentication. The SSH SOCKS system doesn’t need authentication and only runs on loopback, so we leave it off. If you’re using a different SOCKS system, you may need this (and also give the username and password as arguments after it).
Running the command will probably spring an authentication dialogue, just as you have to unlock the Network preference pane.
Then, it’s enabled for the whole system. Solves my Mail.app problem, I can now send that email (and my existing SSH connection isn’t dropped just because the network state changes).
How to disable proxy
You can just as simply disable the proxy.
$ networksetup -setsocksfirewallproxystate Ethernet off
Again, substitute Ethernet for your network service name if necessary (probably either AirPort or Ethernet).
It is also possible, once the settings are remembered by Mac OS X, to just use:
$ networksetup -setsocksfirewallproxystate Ethernet on
The AppleScripts I have made and you can download from above make the process even easier; you just launch the app to switch the proxy setting. If you’re a command line junkie, however, you may prefer to switch from the CLI.
The networksetup command was found thanks to this Mac OS X Hints post.
Find this tutorial useful?