在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:tiny-http/tiny-http开源软件地址:https://github.com/tiny-http/tiny-http开源编程语言:Rust 98.8%开源软件介绍:tiny-httpTiny but strong HTTP server in Rust. Its main objectives are to be 100% compliant with the HTTP standard and to provide an easy way to create an HTTP server. What does tiny-http handle?
Tiny-http handles everything that is related to client connections and data transfers and encoding. Everything else (parsing the values of the headers, multipart data, routing, etags, cache-control, HTML templates, etc.) must be handled by your code. If you want to create a website in Rust, I strongly recommend using a framework instead of this library. InstallationAdd this to the [dependencies]
tiny_http = "0.11" Usageuse tiny_http::{Server, Response};
let server = Server::http("0.0.0.0:8000").unwrap();
for request in server.incoming_requests() {
println!("received request! method: {:?}, url: {:?}, headers: {:?}",
request.method(),
request.url(),
request.headers()
);
let response = Response::from_string("hello world");
request.respond(response);
} SpeedTiny-http was designed with speed in mind:
ExamplesExamples of tiny-http in use:
LicenseThis project is licensed under either of
at your option. ContributionUnless you explicitly state otherwise, any contribution intentionally submitted for inclusion in tiny-http by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论