添加 proxy 函数设置 HTTP 代理
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -139,4 +139,19 @@ abbr -a port 'sudo ss -tulnp | grep'
|
|||||||
abbr -a process 'sudo ps aux | grep'
|
abbr -a process 'sudo ps aux | grep'
|
||||||
abbr -a service 'sudo systemctl list-units --type=service --all | grep'
|
abbr -a service 'sudo systemctl list-units --type=service --all | grep'
|
||||||
|
|
||||||
alias fastfetch="fastfetch --color-keys blue"
|
alias fastfetch="fastfetch --color-keys blue"
|
||||||
|
|
||||||
|
function proxy --description 'Set HTTP proxy for current session'
|
||||||
|
echo -n "HTTP proxy address (e.g. http://192.168.5.14:6152): "
|
||||||
|
read proxy_addr
|
||||||
|
|
||||||
|
if test -n "$proxy_addr"
|
||||||
|
set -gx HTTP_PROXY "$proxy_addr"
|
||||||
|
set -gx HTTPS_PROXY "$proxy_addr"
|
||||||
|
echo "Proxy set: $proxy_addr"
|
||||||
|
else
|
||||||
|
echo "Proxy cleared"
|
||||||
|
set -e HTTP_PROXY
|
||||||
|
set -e HTTPS_PROXY
|
||||||
|
end
|
||||||
|
end
|
||||||
Reference in New Issue
Block a user