Created
March 9, 2021 18:23
-
-
Save ericboehs/c5a65f9f9f5e8ce27b7f5c00dd7d515a to your computer and use it in GitHub Desktop.
LaunchAgent for continually connecting to SOCKS via autossh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Label</key> | |
<string>gov.va.socks</string> | |
<key>KeepAlive</key> | |
<dict> | |
<key>NetworkState</key> | |
<true/> | |
</dict> | |
<key>RunAtLoad</key> | |
<true/> | |
<key>ProgramArguments</key> | |
<array> | |
<string>/opt/homebrew/bin/autossh</string> | |
<string>-v</string> | |
<string>-M</string> | |
<string>20001</string> | |
<string>-D</string> | |
<string>2001</string> | |
<string>socks</string> | |
<string>-N</string> | |
</array> | |
<key>StandardOutPath</key> | |
<string>/Users/ericboehs/Logs/autossh/autossh.stdout</string> | |
<key>StandardErrorPath</key> | |
<string>/Users/ericboehs/Logs/autossh/autossh.stderr</string> | |
<key>User</key> | |
<string>ericboehs</string> | |
<key>ThrottleInterval</key> | |
<integer>30</integer> | |
</dict> | |
</plist> |
Should the user add the plist pac url to their network proxy?
That's what I prefer. But you could also use the omegaproxy extension in Chrome/Firefox. The autosshd solution presented here doesn't presuppose how you'll be connecting to the proxy, just getting the proxy running.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Place this in
~/Library/LaunchAgents
, update the paths from/Users/ericboehs
to something that actually exists, and then run:You'll want to make sure
autossh
is installed (brew install autossh
) and if you're not on a M1 mac, you'll need to change line 16 to/usr/local/bin/autossh
.You'll also need to configure your
socks
host in ~/.ssh/config. But hopefully you've already done that.