Skip to content

Instantly share code, notes, and snippets.

@et2010
Last active June 22, 2023 12:23
Show Gist options
  • Save et2010/5d6edeeb284e33343d0a to your computer and use it in GitHub Desktop.
Save et2010/5d6edeeb284e33343d0a to your computer and use it in GitHub Desktop.
socks proxy settings for emacs url package.
(setq url-gateway-method 'socks)
(setq socks-server '("Default server" "127.0.0.1" 1080 5))
@unixc3t
Copy link

unixc3t commented Aug 29, 2016

Thank you

@boern
Copy link

boern commented Jan 4, 2019

支持http协议吗?

@c02y
Copy link

c02y commented Mar 22, 2021

I got sock5 proxy client(Qv2ray) running in the background, when I want to use it in the terminal, I'll use proxychains cmd, I got socks5 127.0.0.1 1080 in my proxychains.conf file, when I want to use it in my browser, I got SwitchyOmega extension and set it to socks5 127.0.0.1 1080.

I tried this gist in my emacs/spacemacs, it doesn't work at all.

BTW: How can I check if it is using socks proxy? Currently, when I install a package, it hangs and failed to install it, so I believe my emacs is not using the proxy. (When I use proxychains emacs in terminal, it installs pacakge very quickly)

@beacoder
Copy link

I have tried this, it worked.

;;----------------------------------------------------------------------------
;; proxy setting for url-retrieve, used by eww, w3m...
;;----------------------------------------------------------------------------
(setq url-proxy-services
'(("no_proxy" . "^.*example.com")
("https" . "localhost:1087")
("http" . "localhost:1087")
;; socks not working, @see url-default-find-proxy-for-url
;; ("socks5" . "localhost:1080")
))

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