Skip to content

Instantly share code, notes, and snippets.

@rainmote
Last active May 18, 2023 03:55
Show Gist options
  • Save rainmote/b0e39b031796c3bab8a3cd07aff25d03 to your computer and use it in GitHub Desktop.
Save rainmote/b0e39b031796c3bab8a3cd07aff25d03 to your computer and use it in GitHub Desktop.
Discord set proxy

For the Mac version of Discord, I extracted the /Applications/Discord.app/Contents/Resources/app.asar file and found in the code that the Mac update uses electron.autoUpdater, which means the proxy settings do not take effect. My solution is to bypass the autoUpdater. Here are the steps:

  1. Edit the file /Users/admin/Library/Application\ Support/discord/settings.json and add the following two configurations:

    "SKIP_HOST_UPDATE": true,
    "SKIP_MODULE_UPDATE": true
    
  2. Run Discord with proxy parameters using the command:

    /Applications/Discord.app/Contents/MacOS/Discord --proxy-server=127.0.0.1:7890 --ignore-certificate-errors
    

对于Mac版本的discord,我解压了/Applications/Discord.app/Contents/Resources/app.asar,查看代码发现mac更新使用了electron.autoUpdater,所以代理设置不生效。 我的解决方案是跳过autoUpdater,具体操作是:

  1. 编辑文件 /Users/admin/Library/Application\ Support/discord/settings.json,添加以下两个配置项:

    "SKIP_HOST_UPDATE": true,
    "SKIP_MODULE_UPDATE": true
    
  2. 运行以下命令,添加代理参数:

    /Applications/Discord.app/Contents/MacOS/Discord --proxy-server=127.0.0.1:7890 --ignore-certificate-errors
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment