Sign inSign up

xpyctee/apiproxy

By xpyctee

Updated about 1 year ago

Simple api proxy

Image
API management
Developer tools
Web servers
0

277

xpyctee/apiproxy repository overview

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
VariableDescriptionExample ValueDefault
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_PATHPath to socket for the Memcached server."/tmp/memcached.sock""/tmp/memcached.sock"
CACHE_SIZECache size in megabytes."1024""1024"
GUNICORN_WORKERSNumber of Gunicorn workers for handling requests."4""4"
GUNICORN_LOG_LEVELLog level for Gunicorn (e.g., debug, info, warning)."info""info"
GUNICORN_ADDRAddress for Gunicorn to bind to."[::]""[::]"
GUNICORN_PORTPort 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

Authors

Tag summary

Content type

Image

Digest

sha256:d245a5963

Size

90 MB

Last updated

about 1 year ago

docker pull xpyctee/apiproxy:beta