PyServe - v0.2-async
PyServe v0.2-async
Version Numbering
Starting with this release, PyServe adopts a new versioning system:
- First number (X.y): Major updates with significant architecture changes
- Second number (x.Y): Minor updates, new features and patches
- Tags (-async): Indicate variants from the standard version with corresponding patch
This release is labeled v0.2-async to indicate it's a variant of the standard v0.2 with asynchronous architecture.
Major Improvements
This release introduces two significant enhancements to PyServe:
Asynchronous Architecture
PyServe now fully operates on an asynchronous Python stack using asyncio. This significantly improves performance when handling multiple concurrent connections and reduces resource usage.
SSL/TLS Support (HTTPS)
Full support for secure connections via SSL/TLS has been added. You can now run PyServe as an HTTPS server with encrypted traffic.
New Features
- Asynchronous HTTP Server: Non-blocking request processing
- Asynchronous File Operations: Non-blocking read/write operations
- SSL/TLS Support: Traffic encryption between clients and server
- SSL Configuration: Via configuration file or command line
- Extended Documentation: SSL and proxy server guides
- New Command Line Interface: Improved parameters for SSL
Technical Improvements
- Migration from blocking sockets to asynchronous
asyncio.start_server - Implementation of
aiofilesfor asynchronous file operations - Integration of
aiohttpfor improved reverse proxy implementation - Proper handling of SSL certificates through Python SSL context
- Extended server configuration with SSL parameter support
- Improved signal handling for graceful shutdown
Using SSL
Via Configuration File
ssl:
enabled: true
cert_file: ./ssl/cert.pem
key_file: ./ssl/key.pemVia Command Line
python run.py --ssl --cert ./ssl/cert.pem --key ./ssl/key.pemSaving SSL Settings
python run.py --ssl-config --ssl --cert ./ssl/cert.pem --key ./ssl/key.pemNew Dependencies
- aiofiles >= 0.8.0
- aiohttp >= 3.8.1
- cryptography >= 37.0.0
How to Update
- Clone the repository or download the source code
- Install the new dependencies:
pip install -r requirements.txt
Compatibility
The asynchronous version supports all features of the original PyServe, including:
- Static file handling
- Template engine
- Reverse proxy
- Redirections
- YAML configuration
What's Next
Future development of PyServe will focus on:
- Performance improvements
- Enhanced reverse proxy functionality
- WebSocket support
- Template engine capabilities
Feedback and suggestions are welcome through GitHub Issues!
What's Changed
New Contributors
Full changelog:
New Versioning System
- First number (X.y): Major updates with significant architecture changes
- Second number (x.Y): Minor updates, new features and patches
- Tags (-async): Indicate variants from the standard version
Major Improvements
- Asynchronous Architecture: Complete migration to
asynciofor significant performance enhancement - SSL/TLS Support: Secure HTTPS connections with full configuration
- Improved Reverse Proxy: Asynchronous proxy request handling via
aiohttp
Changes
- Extended documentation for SSL and proxy
- Ability to save SSL settings in the configuration file
- Proper connection closure when shutting down the server
- Updated SSL status information on the home page
New Command Line Parameters
--ssl Enable SSL/TLS (HTTPS)
--cert PATH Path to SSL certificate file
--key PATH Path to SSL private key file
--ssl-config Save SSL settings to configuration file
Documentation
- Added instructions for creating and configuring SSL certificates
- Updated reverse proxy documentation
- Added examples of using SSL with reverse proxy
Requirements
Added new dependencies:
- aiofiles >= 0.8.0
- aiohttp >= 3.8.1
- cryptography >= 37.0.0