Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A cross-platform, high-performance and asynchronous web server for static files-serving. ⚡

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
NotificationsYou must be signed in to change notification settings

static-web-server/static-web-server

Static Web Server

A cross-platform, high-performance and asynchronous web server for static files-serving ⚡

Overview

Static Web Server (orSWS abbreviated) is a tiny and fast production-ready web server suitable to serve static web files or assets.

It is focused onlightness and easy-to-use principles while keepinghigh performance and safety powered byThe Rust Programming Language.

Written on top ofHyper andTokio runtime, it providesconcurrent and asynchronous networking abilities and the latest HTTP/1 - HTTP/2 implementations.

Cross-platform and available forLinux,macOS,Windows,FreeBSD,NetBSD,Android,Docker andWasm (viaWasmer).

static-web-server running

Features

  • Built withRust, which focuses onsafety, speed and concurrency.
  • Memory-safe and significantly reduced CPU and RAM overhead.
  • Blazing fast static files-serving and asynchronous powered by the latestHyper,Tokio and a set ofawesome crates.
  • Single4MB (uncompressed) and fully static binary with no dependencies (Musl libc). Suitable for running onany Linux distro orDocker container.
  • Optional GZip, Deflate, Brotli or Zstandard (zstd) compression for text-based web files only.
  • Compression on-demand viaAccept-Encoding header.
  • Partial Content Delivery support for byte-serving of large files.
  • OptionalCache-Control headers for assets.
  • Termination signal handling withgraceful shutdown ability and grace period.
  • HTTP/2 and TLS support.
  • Security headers for HTTP/2 by default.
  • HEAD andOPTIONS responses.
  • Lightweight and configurable logging viatracing crate.
  • Customizable number of blocking and worker threads.
  • Optional directory listing with sorting and JSON output format support.
  • CORS with preflight requests support.
  • Basic HTTP Authentication.
  • Customizable HTTP response headers for specific file requests via glob patterns.
  • Fallback pages for 404 errors, useful for Single-page applications.
  • Run the server as aWindows Service.
  • Configurable using CLI arguments, environment variables or a TOML file.
  • Default and custom error pages.
  • Built-in HTTP to HTTPS redirect.
  • GET/HEAD Health check endpoint.
  • Support for serving pre-compressed (Gzip/Brotli/Zstd) files directly from disk.
  • Custom URL rewrites and redirects via glob patterns with replacements.
  • Virtual hosting support.
  • Multiple index files.
  • Maintenance Mode functionality.
  • Available as a library crate with opt-in features.
  • First-classDocker support.Scratch, latestAlpine Linux andDebian Docker images.
  • Ability to accept a socket listener as a file descriptor for sandboxing and on-demand applications (e.g.systemd).
  • Cross-platform. Pre-compiled binaries for Linux, macOS, Windows, FreeBSD, NetBSD, Android (x86/x86_64,ARM/ARM64) and WebAssembly (viaWasmer).

Documentation

Please refer toThe Documentation Website for more details about the API, usage and examples.

Releases

Benchmarks

For more details seebenchmarks repository

Notes

  • If you're looking forv1 please go to1.x branch.
  • If you want to migrate fromv1 tov2 please viewMigrating fromv1 tov2 release.

Contributions

Unless you explicitly state otherwise, any contribution you intentionally submitted for inclusion in current work, as defined in the Apache-2.0 license, shall be dual licensed as described below, without any additional terms or conditions.

Feel free to submit apull request or file anissue.

Community

SWS Community on Discord

License

This work is primarily distributed under the terms of both theMIT license and theApache License (Version 2.0).

© 2019-presentJose Quintana

About

A cross-platform, high-performance and asynchronous web server for static files-serving. ⚡

Topics

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Code of conduct

Security policy

Stars

Watchers

Forks

Sponsor this project

  •  

Packages

 
 
 

Contributors40


[8]ページ先頭

©2009-2025 Movatter.jp