Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support mac os x's launch_activate_socket (#1003)
In Mac OS X 10.10, `launch_activate_socket` was introduced. So whenever the port is requested, the `launchd` can launch the program dynamically. A possible plist may like this: ``` <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Label</key> <string>com.github.shadowsocks</string> <key>ProgramArguments</key> <array> <string>/path/to/ss-local</string> <string>-s</string> <string>server host</string> <string>-p</string> <string>server port</string> <!-- the -l and -b can be ommited, as launchd takes over it --> <string>-k</string> <string>password</string> <string>-m</string> <string>method</string> <string>-t</string> <string>timeout</string> <string>-A</string> </array> <key>Sockets</key> <dict> <!-- the name is hard coded in ss-local --> <key>Listeners</key> <dict> <key>SockNodeName</key> <string>127.0.0.1</string> <key>SockServiceName</key> <string>socks</string> </dict> </dict> </dict> </plist> ``` The magic is `launchd` will listen to the `SockServiceName`, when the port is requested, the `ss-local` will be launched.
- Loading branch information