Skip to content

Feature/v0.4#26

Open
Gilfeather wants to merge 4 commits intomainfrom
feature/v0.4
Open

Feature/v0.4#26
Gilfeather wants to merge 4 commits intomainfrom
feature/v0.4

Conversation

@Gilfeather
Copy link
Owner

This pull request introduces several new features and improvements to the ezserve project, including gzip compression support, configuration file handling, and IPv6 support. The changes span updates to the README.md, enhancements to the argument parsing and HTTP handling logic, and the addition of gzip compression for text-based content. Below are the most important changes grouped by theme:

New Features

  • Added gzip compression support for text-based files (text/*, application/javascript, application/json, etc.), which can be enabled via the --gzip flag or through the configuration file. ([[1]](https://github.com/Gilfeather/ezserve/pull/26/files#diff-3565aae9dc4e9b06ec65f3e7abbaf8879683b7d2cb1ba8089d3cba2dfed0a3c4R12-R20), [[2]](https://github.com/Gilfeather/ezserve/pull/26/files#diff-3565aae9dc4e9b06ec65f3e7abbaf8879683b7d2cb1ba8089d3cba2dfed0a3c4L217-R307), [[3]](https://github.com/Gilfeather/ezserve/pull/26/files#diff-3565aae9dc4e9b06ec65f3e7abbaf8879683b7d2cb1ba8089d3cba2dfed0a3c4L286-R405))
  • Introduced support for loading settings from a .ezserve.toml configuration file, with the ability to override settings using command-line arguments. ([[1]](https://github.com/Gilfeather/ezserve/pull/26/files#diff-a60003bc403b1b6ce49dd21f8b6d46db57cb34ee6a1b1172bc63cd5d0a01e6a3R1-R32), [[2]](https://github.com/Gilfeather/ezserve/pull/26/files#diff-0055aacae554df5a478d04e59d21fc946375a56a40402c421d0024c030a1b82fL43-R46), [[3]](https://github.com/Gilfeather/ezserve/pull/26/files#diff-0055aacae554df5a478d04e59d21fc946375a56a40402c421d0024c030a1b82fR84-R100))
  • Added IPv6 support, allowing the server to bind to IPv6 addresses (e.g., ::1). ([README.mdR91-R96](https://github.com/Gilfeather/ezserve/pull/26/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5R91-R96))

Enhancements to Argument Parsing and Configuration

  • Updated the argument parser to handle new options such as --gzip and --config <file>. Default settings are now loaded from a .ezserve.toml file if available. ([[1]](https://github.com/Gilfeather/ezserve/pull/26/files#diff-0055aacae554df5a478d04e59d21fc946375a56a40402c421d0024c030a1b82fR23-R24), [[2]](https://github.com/Gilfeather/ezserve/pull/26/files#diff-0055aacae554df5a478d04e59d21fc946375a56a40402c421d0024c030a1b82fL43-R46), [[3]](https://github.com/Gilfeather/ezserve/pull/26/files#diff-0055aacae554df5a478d04e59d21fc946375a56a40402c421d0024c030a1b82fR84-R100))
  • Enhanced the Config struct to include new fields for gzip compression and configuration file paths. ([src/lib.zigR13-R14](https://github.com/Gilfeather/ezserve/pull/26/files#diff-67e24da2124093af503e8762aaddde7401bce3a60d25fcec19ace4dde6360bafR13-R14))

Documentation Updates

  • Updated the README.md to reflect the new version (v0.4.0), added examples for using gzip compression and configuration files, and marked the new features as completed. ([[1]](https://github.com/Gilfeather/ezserve/pull/26/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5L1-R1), [[2]](https://github.com/Gilfeather/ezserve/pull/26/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5R66-R67), [[3]](https://github.com/Gilfeather/ezserve/pull/26/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5L138-R156))

HTTP Request Handling Improvements

  • Enhanced HTTP request handling to detect and respond to Accept-Encoding: gzip headers, enabling gzip compression dynamically based on client support. ([[1]](https://github.com/Gilfeather/ezserve/pull/26/files#diff-3565aae9dc4e9b06ec65f3e7abbaf8879683b7d2cb1ba8089d3cba2dfed0a3c4L85-R98), [[2]](https://github.com/Gilfeather/ezserve/pull/26/files#diff-3565aae9dc4e9b06ec65f3e7abbaf8879683b7d2cb1ba8089d3cba2dfed0a3c4R108-R132))
  • Updated the handleFileRequest and serveSpaFallback functions to support gzipping responses when enabled and applicable. ([[1]](https://github.com/Gilfeather/ezserve/pull/26/files#diff-3565aae9dc4e9b06ec65f3e7abbaf8879683b7d2cb1ba8089d3cba2dfed0a3c4L157-R192), [[2]](https://github.com/Gilfeather/ezserve/pull/26/files#diff-3565aae9dc4e9b06ec65f3e7abbaf8879683b7d2cb1ba8089d3cba2dfed0a3c4L286-R405))

These changes collectively improve the flexibility, performance, and usability of ezserve, making it more suitable for both development and production environments.

Gilfeather and others added 4 commits July 15, 2025 12:04
✨ New Features:
- Configuration file support (.ezserve.toml)
- IPv6 support with automatic IPv4/IPv6 detection
- Command line options for --config and --gzip
- Sample .ezserve.toml configuration file

🔧 Technical Changes:
- Updated version string to 0.4.0
- Enhanced parseAddress() function for IPv4/IPv6
- Simple TOML parser for configuration files
- Updated help text and documentation

⚠️ Notes:
- Gzip compression temporarily disabled (Zig 0.14 API changes)
- Will be re-enabled in v0.5 after API stabilization

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
✨ Features:
- Full gzip compression for text files (HTML, CSS, JS, JSON, XML, SVG)
- Accept-Encoding header parsing (case-insensitive)
- Automatic Content-Encoding: gzip headers
- Compatible with range requests (gzip disabled for partial content)

🔧 Technical Implementation:
- Used Zig 0.14 std.compress.gzip.compressor() API
- Added shouldGzipContent() function for file type detection
- Enhanced HTTP header parsing for Accept-Encoding
- Integrated with existing ETag and caching system

📊 Benefits:
- Significant bandwidth reduction for text files
- Improved page load times
- Maintains compatibility with all existing features

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Auto-formatted src/http.zig and src/lib.zig
- Ensures consistent code style
- All tests and builds pass

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Simplified CI workflow to use ReleaseFast consistently
- Removed debug logging from gzip compression logic
- Extracted compression logic into separate function to reduce binary bloat
- Updated Docker build to use ReleaseFast optimization

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@Gilfeather Gilfeather self-assigned this Jul 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant