在macOS下安装aria2并自动启动RPC

什么是Aria2?

Aria2 is a lightweight download software with Multi-Connection support. Besides HTTP(s) and FTP, it also supports BitTorrent and Metalink.

安装Aria2

最简单的方法是采用homebrew安装aria2

brew install aria2

配置RPC自启动

  • 新增文件并编辑 /usr/local/opt/aria2/homebrew.mxcl.aria2.plist, 内容如下
<!--?xml version="1.0" encoding="UTF-8"?-->
<plist version="1.0">
    <dict>
<key>Label</key>
<string>homebrew.mxcl.aria2</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/opt/aria2/bin/aria2c</string>
<string>--enable-rpc=true</string>
<string>--rpc-secret=yoursecret</string>
<string>--rpc-allow-origin-all=true</string>
<string>--rpc-listen-all=true</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
</dict>
</plist>
  • 然后用homebrew启动这个service,默认端口是6800
brew services start aria2

Leave a Reply

Your email address will not be published.