GithubHelp home page GithubHelp logo

cn-tower / proxy-cmd Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 76 KB

Toggle proxy envrionments (HTTP_PROXY and HTTPS_PROXY) . 通过命令设置、切换和移除代理环境变量

JavaScript 94.31% Batchfile 0.89% TypeScript 3.28% PowerShell 1.52%
http-proxy https-proxy proxy-env proxy-cli proxy-cmd

proxy-cmd's Introduction

PROXY-CMD

Toggle proxy environments (HTTP_PROXY and HTTPS_PROXY) in command line.

npm

Install

npm i -g proxy-cmd

How to use

Windows

Press Win + R, input "cmd", then press Ctrl + Shift + Enter, open cmd as administrator

# Init proxy
proxy-cmd init 'http://127.0.0.1:7890'

# Show proxy target url
proxy-cmd url

# Change proxy target url
proxy-cmd url 'http://127.0.0.1:8234'

# Set global proxy environments, needs administrator privileges
# Needs restart the terminal after running this command
# HTTP_PROXY=http://127.0.0.1:8234
# HTTPS_PROXY=http://127.0.0.1:8234
proxy-cmd set

# Del global proxy environments, needs administrator privileges
# Needs restart the terminal after running this command
proxy-cmd del

# Set current process proxy environments
# HTTP_PROXY=http://127.0.0.1:8234
# HTTPS_PROXY=http://127.0.0.1:8234
proxy-on

# Del current process proxy environments
proxy-off

MacOS or Linux

Run the following commands in terminal

# Init proxy
sudo proxy-cmd init 'http://127.0.0.1:7890'

# Enable proxy-cmd alias
sudo source ~/.bashrc
# MacOs only
sudo source ~/.zshrc

# Show proxy target url
sudo proxy-cmd url

# Change proxy target url
sudo proxy-cmd url 'http://127.0.0.1:8234'

# Set global proxy environments, needs administrator privileges
# Needs restart the terminal after running this command
# HTTP_PROXY=http://127.0.0.1:8234
# HTTPS_PROXY=http://127.0.0.1:8234
sudo proxy-cmd set

# Del global proxy environments, needs administrator privileges
# Needs restart the terminal after running this command
sudo proxy-cmd del

# Set current process proxy environments, should source .zshrc and .bashrc first
# HTTP_PROXY=http://127.0.0.1:8234
# HTTPS_PROXY=http://127.0.0.1:8234
proxy-on

# Del current process proxy environments, should source .zshrc and .bashrc first
proxy-off

proxy-cmd's People

Contributors

cn-tower avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.