All Projects → springlie → smart_switcher

springlie / smart_switcher

Licence: other
[TERMINAL ONLY] Auto-detect proxy switcher for http, https, ftp, rsync, git protocols. It supports many tools such as wget, yum, portage, brew ...

Programming Languages

shell
77523 projects

Projects that are alternatives of or similar to smart switcher

Adium-Steam-IM
Adium protocol plugin to support Steam instant messaging
Stars: ✭ 50 (+35.14%)
Mutual labels:  protocol
ctrdata
Aggregate and analyse information on clinical trials from public registers
Stars: ✭ 26 (-29.73%)
Mutual labels:  protocol
haal
Hääl - Anonymous Electronic Voting System on Public Blockchains
Stars: ✭ 96 (+159.46%)
Mutual labels:  protocol
Credits
Credits(CRDS) - An Evolving Currency For An Evolving Society
Stars: ✭ 14 (-62.16%)
Mutual labels:  protocol
axesync
🎛 blockchain framework for iOS
Stars: ✭ 12 (-67.57%)
Mutual labels:  protocol
apdu-over-ble
Specification of a protocol to transmit APDU commands and responses over Bluetooth Low Energy
Stars: ✭ 17 (-54.05%)
Mutual labels:  protocol
ethereum-crowdsale
0xcert protocol crowdsale contracts for Ethereum blockchain.
Stars: ✭ 15 (-59.46%)
Mutual labels:  protocol
ioBroker.contactid
Contact ID server for burglar alarm system
Stars: ✭ 20 (-45.95%)
Mutual labels:  protocol
simplex-chat
SimpleX - the first messaging platform operating without user identifiers of any kind - 100% private by design! iOS and Android apps are released 📱!
Stars: ✭ 1,975 (+5237.84%)
Mutual labels:  protocol
amongus-protocol
An implementation of the Among Us protocol in typescript.
Stars: ✭ 56 (+51.35%)
Mutual labels:  protocol
How-to-Deconstruct-Ping-with-C-and-NodeJS
🙈 Simple examples that show how to work with binary headers in C and NodeJS
Stars: ✭ 51 (+37.84%)
Mutual labels:  protocol
TXHook
腾讯QQ协议分析工具,为了推进学习与研究。
Stars: ✭ 109 (+194.59%)
Mutual labels:  protocol
network-monorepo
Monorepo containing all the main components of Streamr Network.
Stars: ✭ 223 (+502.7%)
Mutual labels:  protocol
OpenProtocolInterpreter
Converts the ugly package that came from Open Protocol to an object
Stars: ✭ 94 (+154.05%)
Mutual labels:  protocol
hermes-protocol
Definition of the Hermes protocol used by the Snips platform
Stars: ✭ 38 (+2.7%)
Mutual labels:  protocol
open-dis-java
Java implementation of the IEEE-1278.1 Distributed Interactive Simulation (DIS) application protocol v6 and v7 💥
Stars: ✭ 30 (-18.92%)
Mutual labels:  protocol
spec
[OLD!] RGB Protocol specifications for Bitcoin-based digital assets
Stars: ✭ 149 (+302.7%)
Mutual labels:  protocol
ProtocolLib
Provides read and write access to the Minecraft protocol with Bukkit.
Stars: ✭ 625 (+1589.19%)
Mutual labels:  protocol
knx-go
KNX clients and protocol implementation in Go
Stars: ✭ 62 (+67.57%)
Mutual labels:  protocol
GenericProtocol
⚡️ A fast TCP event based buffered server/client protocol for transferring data over the (inter)net in .NET 🌐
Stars: ✭ 38 (+2.7%)
Mutual labels:  protocol

smart_switcher

Auto-detect proxy switcher in terminal. It supports many protocols and tools.


Overview

A smart proxy switcher wrapper, supports http, https, ftp, rsync, ssh(connect depended), git(connect depended) protocols.

It can automatically detect your network environment (in preset set) and fit proxy for you.

It supports multi-proxies.

If you usually switch the network environment (maybe home with no-proxy, workplace1 with proxy1, workplace2 with proxy2), it may help you a lot.

Tested in Zsh and Bash on Linux and Mac.

screenshot

Protocols supported

  • http

  • https

  • ftp

  • rsync

  • ssh

  • git

Tools supported

  • wget

  • ftp

  • rsync

  • yum

  • brew

  • emerge

  • npm

  • pip

  • gopkg

  • git

  • hg

  • svn

  • cvs

Installation

  • Download script (temply set your https proxy if necessary for installation)

export https_proxy={YOUR_PROXY_GATEWARY_IP}:{YOUR_PROXY_GATEWAY_PORT}

git clone https://github.com/springlie/smart_switcher.git /path/to/smart_switcher

  • Set proxies host/port in $SMART_SWITCHER_DIR/gateway.ini.

    [optional] Follow gateway.ini format and customize your multiple proxies.

    [optional] Note: the most common proxies should be set first in the value of "gateways"

  • Source it in your .zshrc (or any shell script resource file like .bashrc):

export SMART_SWITCHER_DIR=/path/to/smart_switcher; source $SMART_SWITCHER_DIR/smart_switcher.sh

Usage

Execute antomatically when user login.

Use command sm_toggle to toggle proxy status when you want.

What's more

cecho

smart_switcher supports cecho, who will bring you some colors.

connect

connect is required to support ssh and git protocols.

Ensure proxy be set temply for installation ...

export http_proxy={YOUR_PROXY_GATEWARY_IP}:{YOUR_PROXY_GATEWAY_PORT}

  • [for Mac]

brew install connect

  • [for Gentoo]

emerge net-misc/connect

  • [for other]

    download the source, make and install it easily in system path

Known issues

  1. When $SHLVL > 1 (means in multi-layers sub-shell), the proxy setting is invalid

  2. ssh can't distinguishes the destination sites before or behind proxy gateway

TODO

  • add protocol header before proxy gateway
  • add username & password
  • add proxy for npm
  • add toggle function
  • specified ssh rule for sites
  • add proxy for svn
  • add automatical setup for connect package
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].