Skip to content

🦄 afire middleware to compress outgoing HTTP traffic

Notifications You must be signed in to change notification settings

connorslade/afire-compress

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

afire-compress

🦄 afire middleware to compress outgoing HTTP traffic.

Supports Gzip, Deflate, and Brotli. Make sure this is the first middleware added to a server.

Example

use afire::{Method, Response, Server};
use afire_compress::{Compress, CompressType};

fn main() {
    let mut server = Server::new("localhost", 8080);

    // Add Compressor
    Compress::new().attach(&mut server);

    server.route(Method::GET, "/", |_| Response::new().text("Hello World"));

    server.start().unwrap();
}

About

🦄 afire middleware to compress outgoing HTTP traffic

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages