Skip to content

Instantly share code, notes, and snippets.

@mzpqnxow
Created August 24, 2020 04:45
Show Gist options
  • Save mzpqnxow/ca4b4ae0accf2d3b275537332ccbe86e to your computer and use it in GitHub Desktop.
Save mzpqnxow/ca4b4ae0accf2d3b275537332ccbe86e to your computer and use it in GitHub Desktop.
Use SOCKS5 proxy with Discord on Linux

Using SOCKS5 Proxy With Discord on Linux

You may only need the environment or the command-line parameter to force Discord to use a proxy. It doesn't hurt to use both

So if you're behind a firewall and need to go through, e.g. an SSH dynamic port forward (a SOCKS5 channel inside an SSH session) you can use the following:

$ nohup ssh -D1080 proxy_server &
$ http_proxy=socks5://127.0.0.1:1080 https_proxy=socks5://127.0.0.1:1080 /opt/Discord/Discord --proxy-server="socks5://127.0.0.1:1080"

If you use some window manager in Xorg and it uses the .desktop style launch configurations (Xfce and probably others) using the following will accomplish the same thing for the context-menu / button launch:

$ cat .local/share/applications/discord.desktop
[Desktop Entry]
Name=Discord
StartupWMClass=discord
Comment=All-in-one voice and text chat for gamers that's free, secure, and works on both your desktop and phone.
GenericName=Internet Messenger
Exec=env http_proxy=socks5://127.0.0.1:1080 https_proxy=socks5://127.0.0.1:1080 /opt/Discord/Discord --proxy-server="socks5://127.0.0.1:1080"
Icon=discord
Type=Application
Categories=Network;InstantMessaging;
Path=/tmp

The proxy URI can also be http://, https:// and possibly socks4://, socks4a:// or socks5h:// though I have not tested these

@MdNihal05
Copy link

Hey how can i use Proxy in my discord
It it provided by my college with some credentials like host:xxxx.ac.in username:xxxxx password:xxxxxxx
i can use proxy in terminal and browser but i can't use discord can you help me

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