Skip to content

XpycTee/api-proxy

Repository files navigation

Simple APIProxy

To run APIProxy:

docker run -d \
    --name=apiproxy \
    -v=apiproxy_config:/opt/proxy/config \
    -v=apiporxy_logs:/opt/proxy/logs \
    -p=8080:8080 \
    xpyctee/apiproxy

Configuration (/opt/proxy/config/config.yaml):

urls:
  steam: # Prefix
    url: 'https://steamcommunity.com' # Base redirect url
    rate_limit: 30  # (Optional) Queries per minute

Example Request:

http://[::1]:8080/PREFIX/..endpoint..

STAEMID=12345678....

curl 'http://127.0.0.1:8080/steam/inventory/$STEAMID/730/2?l=english&count=100'

This redirects to https://steamcommunity.com/inventory/$STEAMID/730/2?l=english&count=100, proxying the request with headers and query arguments using GET or POST.

Environment Variables

Variable Description Example Value Default
APIPROXY_URL_* APIPROXY_URL_steam - url for prefix steam "https://steamcommunity.com" None
APIPROXY_RATE_* APIPROXY_RATE_steam - Rate limit for prefix steam "30" "0"
MEMCACHE_PATH Path to socket for the Memcached server. "/tmp/memcached.sock" "/tmp/memcached.sock"
CACHE_SIZE Cache size in megabytes. "1024" "1024"
GUNICORN_WORKERS Number of Gunicorn workers for handling requests. "4" "4"
GUNICORN_LOG_LEVEL Log level for Gunicorn (e.g., debug, info, warning). "info" "info"
GUNICORN_ADDR Address for Gunicorn to bind to. "[::]" "[::]"
GUNICORN_PORT Port for Gunicorn to listen on. "8080" "8080"

To run APIProxy without config file:

docker run -d \
    --name=apiproxy \
    -e=APIPROXY_URL_steam=https://steamcommunity.com \
    -e=APIPROXY_RATE_steam=30 \
    -e=APIPROXY_URL_test=http://localhost:8081 \
    -p=8080:8080 \
    xpyctee/apiproxy

DockerHub

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published