Metadata-Version: 2.4
Name: lib-gateway-port
Version: 1.2.7
Summary: High-performance HTTP gateway and reverse proxy with security features
Home-page: https://github.com/gateway-port/lib-gateway-port
Author: Gateway Port Development Team
Author-email: dev@gateway-port.io
Project-URL: Bug Tracker, https://github.com/gateway-port/lib-gateway-port/issues
Project-URL: Documentation, https://gateway-port.readthedocs.io
Project-URL: Source, https://github.com/gateway-port/lib-gateway-port
Keywords: gateway proxy reverse-proxy http server security firewall load-balancer
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: System Administrators
Classifier: Topic :: Internet :: Proxy Servers
Classifier: Topic :: Internet :: WWW/HTTP :: HTTP Servers
Classifier: Topic :: Security
Classifier: Topic :: System :: Networking
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Operating System :: OS Independent
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: keywords
Dynamic: license-file
Dynamic: project-url
Dynamic: requires-python
Dynamic: summary

# 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

```bash
pip install lib-gateway-port
```

## Quick Start

```python
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

```python
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

- Documentation: https://gateway-port.readthedocs.io
- Issues: https://github.com/gateway-port/lib-gateway-port/issues
- Source: https://github.com/gateway-port/lib-gateway-port
