Skip to content

Commit

Permalink
Improve proxy functions.
Browse files Browse the repository at this point in the history
  • Loading branch information
seagle0128 committed Aug 21, 2019
1 parent 1657063 commit 33bd0de
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions lisp/init-funcs.el
Original file line number Diff line number Diff line change
Expand Up @@ -276,22 +276,23 @@
(defun proxy-socks-enable ()
"Enable SOCKS proxy."
(interactive)
(setq url-gateway-method 'socks)
(setq socks-noproxy '("localhost"))
(setq socks-server '("Default server" "127.0.0.1" 1086 5))
(require 'socks)
(setq url-gateway-method 'socks
socks-noproxy '("localhost")
socks-server '("Default server" "127.0.0.1" 1086 5))
(proxy-socks-show))

(defun proxy-socks-disable ()
"Disable SOCKS proxy."
(interactive)
(setq url-gateway-method 'native)
(setq socks-noproxy nil)
(setq url-gateway-method 'native
socks-noproxy nil)
(proxy-socks-show))

(defun proxy-socks-toggle ()
"Toggle SOCKS proxy."
(interactive)
(if socks-noproxy
(if (bound-and-true-p socks-noproxy)
(proxy-socks-disable)
(proxy-socks-enable)))

Expand Down

0 comments on commit 33bd0de

Please sign in to comment.