High-performance HTTP gateway and reverse proxy with security features
Project description
lib-gateway-port
A lightweight, high-performance HTTP gateway and reverse proxy library for Python applications.
Features
- Path-Based Access Control: Define protected routes with flexible ACL rules
- Request Validation: Built-in validation and sanitization for security
- Connection Pooling: Efficient backend connection management
- Production Ready: Battle-tested in high-traffic production environments
- Zero Dependencies: Pure Python implementation with no external requirements
- Easy Integration: Simple API for quick deployment
Installation
pip install lib-gateway-port
Quick Start
from lib_gateway_port import SecurityGateway
# Initialize gateway
gateway = SecurityGateway(
backend_host="127.0.0.1",
backend_port=5000,
listen_port=9000,
protected_paths=["/admin/", "/internal/"]
)
# Start the gateway
gateway.start()
Configuration Options
gateway = SecurityGateway(
backend_host="127.0.0.1", # Backend server address
backend_port=5000, # Backend server port
listen_port=9000, # Gateway listening port
protected_paths=["/admin/"], # Paths requiring access control
max_connections=100, # Maximum concurrent connections
request_timeout=30 # Request timeout in seconds
)
Use Cases
- API Gateway: Route and protect REST APIs
- Microservices: Central entry point for microservice architectures
- Legacy Applications: Add security layer to existing applications
- Access Control: Implement path-based authentication requirements
- Load Distribution: Balance traffic across backend servers
Architecture
Client Request → Gateway (ACL + Validation) → Backend Application
↓
Protected Paths
Request Sanitization
Connection Pooling
Security
This library implements industry-standard security practices:
- Request validation and sanitization
- Path normalization to prevent traversal attacks
- Connection timeout management
- Access control list enforcement
Performance
Optimized for high-throughput production environments:
- Persistent backend connections for reduced latency
- Efficient request parsing and routing
- Minimal memory footprint
- Suitable for handling thousands of requests per second
License
MIT License - See LICENSE file for details
Support
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lib_gateway_port-1.2.7.tar.gz.
File metadata
- Download URL: lib_gateway_port-1.2.7.tar.gz
- Upload date:
- Size: 6.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3d613399492e81d42d5b6eb8cd5ca9e057817c303e46326f66de334be9bb3f8e
|
|
| MD5 |
85c1e1df398af9dd3cacb5042edb5a91
|
|
| BLAKE2b-256 |
bc6f8b8273ab4e939b97d4b46fd1d0a18834114e4f23f359f7344feb86504ff8
|
File details
Details for the file lib_gateway_port-1.2.7-py3-none-any.whl.
File metadata
- Download URL: lib_gateway_port-1.2.7-py3-none-any.whl
- Upload date:
- Size: 6.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
88e65a3d5fa981d0e12930b6d4f894e613a9230449ab41f8f77a3ee35544c3bb
|
|
| MD5 |
ad81c2e91ebb3378ee16fcdc804eafa4
|
|
| BLAKE2b-256 |
e4c84466701ce27ea628e344864d4ad2e6fa23035327ab8646d70fbbac217ead
|