Skip to content

Repository files navigation

HTTP Delay Proxy

Self-hosted HTTP proxy for scheduling delayed message delivery. Accepts requests and forwards them after a specified delay (0 seconds to ~68 years).

What & Why

What: Simple API - target URL in path, delay in header, forwards with original headers/body.

Why: Replaces unreliable third-party SaaS HTTP schedulers

How: Redis sorted sets with timestamp-based job scheduling. At-least-once delivery guarantee.

Tech Stack

  • Python 3.13 + uv
  • FastAPI + uvloop (high-performance HTTP API)
  • Redis sorted sets (timestamp-based scheduling)
  • Docker

Log Events Reference

Format: YYYY-MM-DD HH:MM:SS.mmm [LEVEL] EVENT [request_id] key=value ...

Startup

EventLevelDescription
APP_STARTINFOApplication starting
EVENT_LOOPINFOEvent loop type
REDIS_CONNECTINFORedis connection established
WORKER_TASKINFOBackground worker task created
WORKER_STARTINFOWorker polling loop started

Request Lifecycle

EventLevelDescription
HTTP_ACCESSINFOUvicorn access log
REQUESTINFOIncoming scheduling request
AUTH_FAILWARNAPI key validation failed
BODY_PARSEWARNJSON body parsing failed
ENQUEUEINFOJob added to queue
ENQUEUE_FAILERRORFailed to add job to queue

Worker

EventLevelDescription
BATCH_ACQUIREINFOJobs retrieved from queue
PROCESSINFOProcessing a job
FORWARDINFOStarting HTTP forward
RESPONSEINFOHTTP forward completed
FORWARD_ERRORERRORHTTP forward failed
BATCH_DONEINFOBatch processing complete
WORKER_ERRORERRORUnexpected worker error

Redis (DEBUG level)

EventLevelDescription
REDIS_ZADDDEBUGJob added to sorted set
REDIS_ZRANGEBYSCOREDEBUGJobs queried
REDIS_ZREMRANGEBYSCOREDEBUGJobs removed

Shutdown

EventLevelDescription
REDIS_CLOSEINFORedis connection closed
SHUTDOWNINFOApplication shutdown complete

About

Basic http request delay tool

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages