Redis driven proxy
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Markus Bergholz 6016e7b223 improve docs about environment and redis 2 years ago
.gitignore Initial commit 2 years ago
Dockerfile use 'redis' as default hostname for redis instead of 127.0.0.1 2 years ago
README.md improve docs about environment and redis 2 years ago
rdproxy.py take rdproxy port and hostname from redis connection 2 years ago

README.md

rdproxy

redis driven proxy

  1. Just start python rdproxy 8000
  2. e.g. in redis-cli set u "http://127.0.0.1:8080/
  3. Browse http://127.0.0.1:8000/u and you get the content of your other app running on port 8080

deps

  • python 3
  • pip install bottle redis requests

setup

rdproxy is using environment variables instead of a config file.

  • REDIS_HOST
    • default value localhost
  • REDIS_PORT
    • default vvalue 6379
  • REDIS_DB
    • default value 0
  • REDIS_PASSWORD
    • no default value

In redis you can set the following keys for rdproxy

  • RDPROXY:PORT
    • default 8000
  • RDPROXY:HOST
    • default localhost
  • RDPROXY:DEBUG
    • default false

e.g. 127.0.0.1:6379> set "RDPROXY:PORT" 8080

docker

  1. make redis available
    • docker run -d --name redis --net mynet -p 6379:6379 redis:alpine
  2. make some of your apps available
    • docker run -d --name u1 --net mynet u:latest
    • this one is a static page which listen on port 80, but not available from host
  3. add route in redis
    • set u "http://u1"
    • don’t forget http://! (https is not supported)
  4. run rdproxy
    • docker run -d --name rdproxy --net mynet -p 80:80 -e REDIS_HOST=redis rdproxy:latest
  5. enter in your browser http://127.0.0.1/u/ and your docker server from step 2 will be available