Simple, very fast, in a single binary, with web UI HTTP redirect service
590
Simple, very fast, in a single binary, with web UI HTTP redirect service
Precompilled binaries: release page
From source (required Go toolchain):
go get -v -u github.com/reddec/redirect/...
snapcraft use redirect-to package

Translate this ports as you wish:
10100 - main redirect server10101 - UI web panelUse exposed volume /etc/redirect to persist data
Redirect address (default "0.0.0.0:10100"). You can do any HTTP operation to address http://your-server:10100/your/cool/service/name and it will be redirected to specified address
File to save configuration (default "./redir.json"). It will be loaded at startup (if exists) and saved after each modification operation over API
Directory of static UI files. If not defined - embedded used
Address for UI (default "127.0.0.1:10101")
/ - Will be served as static directory from specified directory/ui/ - UI interface/api/ - API handlersGET/POST/PUT/DELETE - returns redirection with 302 Found statusHEAD - returns only real service location in Location header with 200 OK statusGet list of services or detailed information of one service if service name provided.
Adds into response headers (X-Redir-Port) port of main server
http://ui-addr/api/http://ui-addr/api/your/cool/service/nameAdd or update one service. If service already exists, hits will saved. Expects this form fields:
service - service nametemplate - content of templateEach template must be valid expression of Go template engine with http request as environment.
service = googletemplate = http://google.comAll requests to http://127.0.0.1:10100/google will be redirected to http://google.com
service = mdn
template
https://developer.mozilla.org/ru/docs/Web/JavaScript/Reference/Global_Objects/{{.URL.Query.Get "q"}}
All requests to http://127.0.0.1:10100/mdn?q=QUERY will be redirected to https://developer.mozilla.org/ru/docs/Web/JavaScript/Reference/Global_Objects/QUERY
E.x.:
http://127.0.0.1:10100/mdn?q=encodeuricomponent maps to
https://developer.mozilla.org/ru/docs/Web/JavaScript/Reference/Global_Objects/encodeuricomponent
http://ui-addr/api/Remove service if it exists
http://ui-addr/api/your/cool/service/nameContent type
Image
Digest
Size
3.1 MB
Last updated
over 5 years ago
docker pull reddec/redirect