Go proxy which can switch between Direct mode and Cascade mode Switch is done according to health check.
Just download the current release For running as daemon checkout the section in this readme
checkout the source code and run
make install
Configuration can be done by file or command line arguments
- password : Password for authentication to a forward proxy
- host : Address of a forward proxy
- user : Username for authentication to a forward proxy
- port : Port on which to run the proxy
- health : Address which is used for health check if available go to direct mode (default: https://www.google.de )
- health-time : Duration between health checks (default: 30 Seconds )
- host-list : Comma Separated List of Host for which Proxy Redirect is used in Cascade Mode
- config : Path to configuration yaml file. If set all other command line parameters will be ignored
- version: Just shows the current version
- vault-addr: address to the hashi corp vault
- vault-token: token for the hashi corp vault
A temporary client tries to connect to a certain address regularly. The Cascade mode is active if health check fails.
Normal http internet Proxy Mode.
Cascade Mode means that this proxy stands between the client and another Proxy. Basic Authentication can be enabled for Cascade Mode
If in cascade mode, different Proxy redirects can be added by adding a Comma seperated list. These redirects changes HTTPS and HTTP Request according to the setup rules. The Requests can be send to another Proxy or directly.
Direct Configuration:
- DIRECT Connection: eclipse
- DIRECT Connection: azure->
- REDIRECT Connection to other Proxy: google->test:8888
Cascade can also get the configuration from a HashiCorp Vault. The secret store has to be version 2 and a vault configuration will overwrite a file configuration. The following secrets have to be saved in store:
- username
- password
- host
The following secrets are optional:
- port (default: 8888)
- host-list (default: "")
- health (default: www.google.de)
- log (default: WARNING)
- health-time (default: 5s)
- disableAutoChangeMode (default: false)
Cascade comes with a REST Interface which can be used to control the application. Currently the following REST Endpoints are available:
- /config : is used to return the current configuration
- /getOnlineCheck : is used to get if the check is used to check for up
- /getAutoMode : is used to get if automatically switching between modes is activated
- /addRedirect : adds another redirect rule
- /setOnlineCheck : used to configure check is used to check for a website being online
- /setAutoMode : used to disable automatically switching between modes
- /setCascadeMode : used to force a certain mode
These examples use curl to use the REST Endpoints
To get the current configuration
curl -D- localhost/config
To set the Mode by hand to DirectMode:
curl -D- --request POST \
--data '{"cascadeMode":false}' \
localhost/setCascadeMode
To set the Mode by hand to Cascade mode:
curl -D- --request POST \
--data '{"cascadeMode":true}' \
localhost/setCascadeMode
To disable the automatically switch between modes:
curl -D- --request POST \
--data '{"autoChangeMode":false}' \
localhost/setAutoMode
To enable the automatically switch between modes:
curl -D- --request POST \
--data '{"autoChangeMode":true}' \
localhost/setAutoMode
will overwrite the setting from file,vault or command line
If you want to use the provided service configuration, the program has to be moved to
/usr/local/bin
The configuration has to be moved to the following folder for Ubuntu:
/etc/systemd/system/
Afterwards, systemd has to be restarted as follows:
systemctl daemon-reload
systemctl start cascade
The logs can be viewed by using:
journalctl -f -u cascade