Skip to content

Instantly share code, notes, and snippets.

@Colk-tech
Last active May 1, 2024 15:57
Show Gist options
  • Save Colk-tech/157fd6c81032dde528d3a22434b8f3e6 to your computer and use it in GitHub Desktop.
Save Colk-tech/157fd6c81032dde528d3a22434b8f3e6 to your computer and use it in GitHub Desktop.
discord-with-proxy
#!/bin/sh
/Applications/Discord.app/Contents/MacOS/Discord --proxy-server=http://po.cc.ibaraki-ct.ac.jp:3128
@rainbird
Copy link

http_proxy=http://127.0.0.1:8118 https_proxy=http://127.0.0.1:8118 /Applications/Discord.app/Contents/MacOS/Discord --proxy-server="http://127.0.0.1:8118"

work for me

@zeroxia
Copy link

zeroxia commented Mar 8, 2023

Does not work on Windows.

@e5st7
Copy link

e5st7 commented May 1, 2023

For Windows users reading this, there has been work done in the discord-proxy project, with the original guide in this Zhihu post.
Extract the included dll from release to the app folder at %localappdata%/Discord, add the proxy argument to a Discord.exe shortcut. If Discord doesn't start, make a shortcut to the Update.exe instead and add the argument there.

A even more convenient, experimental method would be the DiscordProxyStart project, which eliminates the need to manually replace the dll file.

@wangwendong1024
Copy link

It seems that Update.exe is written in C# language. All C# programs support the use of. config configuration items to configure process agents. Save the following content as Update.exe.config and store it in the same directory as Update.exe.

<?xml version="1.0" encoding="utf-8"?> <configuration> <configSections> </configSections> <system.net> <!--Configure fiddler local proxy--> <defaultProxy> <proxy autoDetect="false" bypassonlocal="false" proxyaddress="http://127.0.0.1:1080" usesystemdefault="false" /> </defaultProxy> </system.net> </configuration>

@zeroxia
Copy link

zeroxia commented May 6, 2023

For Windows users reading this, there has been work done in the discord-proxy project, with the original guide in this Zhihu post. Extract the included dll from release to the app folder at %localappdata%/Discord, add the proxy argument to a Discord.exe shortcut. If Discord doesn't start, make a shortcut to the Update.exe instead and add the argument there.

A even more convenient, experimental method would be the DiscordProxyStart project, which eliminates the need to manually replace the dll file.

On 2023/5/6 this still works. Although there is one issue for the helper project DiscordProxyStart:

  1. Initially C:\Users\<USERNAME>\AppData\Local\Discord contains the application in sub-folder "app-1.0.9012"
  2. Using "DiscordProxyStart.exe" you can see it successfully connects as long as you've configured your proxy correctly
  3. Then "Update.exe" downloads a newer app version "app-1.0.9013", and the process restarts
  4. Now "Update.exe" is unable to connect since the "version.dll" file is not copied into new app sub-folder "app-1.0.9013"

It seems that Update.exe is written in C# language. All C# programs support the use of. config configuration items to configure process agents. Save the following content as Update.exe.config and store it in the same directory as Update.exe.

<?xml version="1.0" encoding="utf-8"?> <configuration> <configSections> </configSections> <system.net> <!--Configure fiddler local proxy--> <defaultProxy> <proxy autoDetect="false" bypassonlocal="false" proxyaddress="http://127.0.0.1:1080" usesystemdefault="false" /> </defaultProxy> </system.net> </configuration>

This does not work. If it's that simple, there would be no need to create a project like the discord-proxy

@e5st7
Copy link

e5st7 commented May 9, 2023

@zeroxia I too have experienced the same issue when Discord updated. As a workaround, you can copy the original version.dll from the old app folder to the new app folder and start DiscordProxyStart again. Maybe it will be fixed in future releases @aiqinxuancai?

@aiqinxuancai
Copy link

aiqinxuancai commented May 10, 2023

For Windows users reading this, there has been work done in the discord-proxy project, with the original guide in this Zhihu post. Extract the included dll from release to the app folder at %localappdata%/Discord, add the proxy argument to a Discord.exe shortcut. If Discord doesn't start, make a shortcut to the Update.exe instead and add the argument there.
A even more convenient, experimental method would be the DiscordProxyStart project, which eliminates the need to manually replace the dll file.

On 2023/5/6 this still works. Although there is one issue for the helper project DiscordProxyStart:

  1. Initially C:\Users\<USERNAME>\AppData\Local\Discord contains the application in sub-folder "app-1.0.9012"
  2. Using "DiscordProxyStart.exe" you can see it successfully connects as long as you've configured your proxy correctly
  3. Then "Update.exe" downloads a newer app version "app-1.0.9013", and the process restarts
  4. Now "Update.exe" is unable to connect since the "version.dll" file is not copied into new app sub-folder "app-1.0.9013"

It seems that Update.exe is written in C# language. All C# programs support the use of. config configuration items to configure process agents. Save the following content as Update.exe.config and store it in the same directory as Update.exe.
<?xml version="1.0" encoding="utf-8"?> <configuration> <configSections> </configSections> <system.net> <!--Configure fiddler local proxy--> <defaultProxy> <proxy autoDetect="false" bypassonlocal="false" proxyaddress="http://127.0.0.1:1080" usesystemdefault="false" /> </defaultProxy> </system.net> </configuration>

This does not work. If it's that simple, there would be no need to create a project like the discord-proxy

@zeroxia I too have experienced the same issue when Discord updated. As a workaround, you can copy the original version.dll from the old app folder to the new app folder and start DiscordProxyStart again. Maybe it will be fixed in future releases @aiqinxuancai?
[@e5st7]
https://github.com/aiqinxuancai/DiscordProxyStart/releases/tag/v0.0.6
This issue should have been fixed already.

@rainmote
Copy link

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
    

@liusept
Copy link

liusept commented Jun 11, 2023

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
    

Thanks, he works on my macos

@MdNihal05
Copy link

Hello
I use Linux ( Linux 6.5.0-kali3-amd64 ) Gnome version 44.1
How can i use discord using proxy ( with my credentials provided by college )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment