├── .github ├── FUNDING.yml └── workflows │ └── benchmark.yml ├── .editorconfig ├── python-http-client └── python-http-client.py ├── rust-ureq ├── Cargo.toml ├── src │ └── main.rs └── Cargo.lock ├── rust-attohttpc ├── Cargo.toml ├── src │ └── main.rs └── Cargo.lock ├── rust-reqwest ├── Cargo.toml ├── src │ └── main.rs └── Cargo.lock ├── rust-hyper ├── Cargo.toml ├── src │ └── main.rs └── Cargo.lock ├── rust-http-server ├── Cargo.toml ├── src │ └── main.rs └── Cargo.lock ├── cpp-asio-httpclient ├── build.zig.zon ├── build.zig └── src │ └── main.cpp ├── cpp-asio-httpserver ├── build.zig.zon ├── src │ └── main.cpp └── build.zig ├── .gitignore ├── go-http-client └── go-http-client.go ├── LICENSE ├── zig-http-client ├── src │ └── main.zig └── build.zig ├── git-yolo ├── src │ └── main.zig └── build.zig ├── zig-http-server ├── build.zig └── src │ └── main.zig ├── bench.sh └── README.md /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: orhun 2 | patreon: orhunp 3 | custom: ["https://www.buymeacoffee.com/orhun"] 4 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # configuration for https://editorconfig.org 2 | 3 | root = true 4 | 5 | [*.sh] 6 | indent_style = space 7 | indent_size = 2 8 | -------------------------------------------------------------------------------- /python-http-client/python-http-client.py: -------------------------------------------------------------------------------- 1 | import requests 2 | 3 | url = "http://127.0.0.1:8000/get" 4 | s = requests.Session() 5 | 6 | for i in range(1000): 7 | response = s.get(url, headers={"connection": "keep-alive"}) 8 | print(f"{i + 1} {response.text}") 9 | -------------------------------------------------------------------------------- /rust-ureq/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "rust-ureq" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | ureq = { version = "2.7.1", default-features = false } 8 | 9 | [profile.release] 10 | opt-level = 3 11 | debug = false 12 | panic = "unwind" 13 | lto = true 14 | codegen-units = 1 15 | strip = true 16 | -------------------------------------------------------------------------------- /rust-attohttpc/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "rust-attohttpc" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | attohttpc = { version = "0.25.0", default-features = false } 8 | 9 | [profile.release] 10 | opt-level = 3 11 | debug = false 12 | panic = "unwind" 13 | lto = true 14 | codegen-units = 1 15 | strip = true 16 | -------------------------------------------------------------------------------- /rust-attohttpc/src/main.rs: -------------------------------------------------------------------------------- 1 | fn main() -> Result<(), Box> { 2 | for i in 1..=1000 { 3 | let response: String = attohttpc::get("http://127.0.0.1:8000/get") 4 | .header("connection", "keep-alive") 5 | .send()? 6 | .text()?; 7 | println!("{i} {response}"); 8 | } 9 | 10 | Ok(()) 11 | } 12 | -------------------------------------------------------------------------------- /rust-reqwest/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "rust-reqwest" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | reqwest = { version = "0.11.18", default-features = false } 8 | tokio = { version = "1.29.1", features = ["rt"] } 9 | 10 | [profile.release] 11 | 12 | opt-level = 3 13 | debug = false 14 | panic = "unwind" 15 | lto = true 16 | codegen-units = 1 17 | strip = true 18 | -------------------------------------------------------------------------------- /rust-hyper/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "rust-hyper" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | hyper = { version = "0.14.27", features = ["client", "http1", "runtime"] } 8 | tokio = { version = "1.29.1", features = ["rt"] } 9 | 10 | [profile.release] 11 | opt-level = 3 12 | debug = false 13 | panic = "unwind" 14 | lto = true 15 | codegen-units = 1 16 | strip = true 17 | -------------------------------------------------------------------------------- /rust-http-server/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "rust-http-server" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | hyper = { version = "0.14.27", features = ["http1", "runtime", "server"] } 8 | tokio = { version = "1.29.1", features = ["rt"] } 9 | 10 | [profile.release] 11 | opt-level = 3 12 | debug = false 13 | panic = "unwind" 14 | lto = true 15 | codegen-units = 1 16 | strip = true 17 | -------------------------------------------------------------------------------- /cpp-asio-httpclient/build.zig.zon: -------------------------------------------------------------------------------- 1 | .{ 2 | .name = "cpp-asio-httpclient", 3 | .version = "0.1.0", 4 | .license = "MIT", 5 | .dependencies = .{ 6 | .asio = .{ 7 | .url = "https://github.com/kassane/asio/archive/2e97b6a4d37be85529d191380eeda67240fd61fe.tar.gz", 8 | .hash = "12208b60f54e758b964ad3038973b7c4198d40ed6d6ea2955b6e44cee971e6edeb5e", 9 | }, 10 | }, 11 | } 12 | -------------------------------------------------------------------------------- /rust-ureq/src/main.rs: -------------------------------------------------------------------------------- 1 | fn main() -> Result<(), Box> { 2 | let client = ureq::builder().no_delay(true).build(); 3 | 4 | for i in 1..=1000 { 5 | let response = client 6 | .get("http://127.0.0.1:8000/get") 7 | .set("connection", "keep-alive") 8 | .call()? 9 | .into_string()?; 10 | println!("{i} {response}"); 11 | } 12 | 13 | Ok(()) 14 | } 15 | -------------------------------------------------------------------------------- /cpp-asio-httpserver/build.zig.zon: -------------------------------------------------------------------------------- 1 | .{ 2 | .name = "cpp-asio-httpserver", 3 | .version = "0.1.0", 4 | .license = "MIT", 5 | .dependencies = .{ 6 | .standaloneServer = .{ 7 | .url = "https://github.com/kassane/Standalone-Server/archive/12af18dfce121f5c6dc59702a0bbf99ce69f1677.tar.gz", 8 | .hash = "1220b0320efd82e58de88d8a7ea86777efd39cb6196b2a4abdcdf3e264707121770e", 9 | }, 10 | }, 11 | } 12 | -------------------------------------------------------------------------------- /cpp-asio-httpserver/src/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using HttpServer = SimpleWeb::Server; 6 | 7 | int main() { 8 | // Create the HTTP server 9 | HttpServer server; 10 | server.config.port = 8000; 11 | 12 | // Define the request handler 13 | server.resource["^/get$"]["GET"] = [](std::shared_ptr response, std::shared_ptr request) { 14 | std::string content = "C++ Bits!\n"; 15 | *response << "HTTP/1.1 200 OK\r\nContent-Length: " << content.length() << "\r\n\r\n" << content; 16 | }; 17 | 18 | // Start the server 19 | std::cout << "Server started on port 8000." << std::endl; 20 | server.start(); 21 | 22 | return 0; 23 | } 24 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ### Zig ### 2 | zig-cache/ 3 | zig-out/ 4 | build/ 5 | build-*/ 6 | docgen_tmp/ 7 | 8 | ### Rust ### 9 | # Generated by Cargo 10 | # will have compiled files and executables 11 | debug/ 12 | target/ 13 | 14 | # These are backup files generated by rustfmt 15 | **/*.rs.bk 16 | 17 | # MSVC Windows builds of rustc generate these, which store debugging information 18 | *.pdb 19 | 20 | ### Go ### 21 | # Binaries for programs and plugins 22 | *.exe 23 | *.exe~ 24 | *.dll 25 | *.so 26 | *.dylib 27 | 28 | # Test binary, built with `go test -c` 29 | *.test 30 | 31 | # Output of the go coverage tool, specifically when used with LiteIDE 32 | *.out 33 | 34 | # Dependency directories (remove the comment below to include it) 35 | # vendor/ 36 | 37 | # Go workspace file 38 | go.work 39 | 40 | # Go binary 41 | go-http-client/go-http-client 42 | 43 | ### Benchmarks ### 44 | benchmarks.* 45 | -------------------------------------------------------------------------------- /rust-reqwest/src/main.rs: -------------------------------------------------------------------------------- 1 | use std::time::Duration; 2 | 3 | use reqwest::Client; 4 | 5 | fn main() -> Result<(), Box> { 6 | tokio::runtime::Builder::new_current_thread() 7 | .enable_all() 8 | .build()? 9 | .block_on(async { 10 | let client = Client::builder() 11 | .tcp_nodelay(true) 12 | .tcp_keepalive(Some(Duration::from_secs(30))) 13 | .build()?; 14 | 15 | for i in 1..=1000 { 16 | let response = client 17 | .get("http://127.0.0.1:8000/get") 18 | .header("connection", "keep-alive") 19 | .send() 20 | .await? 21 | .text() 22 | .await?; 23 | println!("{i} {response}"); 24 | } 25 | 26 | Ok(()) 27 | }) 28 | } 29 | -------------------------------------------------------------------------------- /rust-http-server/src/main.rs: -------------------------------------------------------------------------------- 1 | use std::{ 2 | convert::Infallible, 3 | net::{Ipv4Addr, SocketAddr}, 4 | }; 5 | 6 | use hyper::{ 7 | service::{make_service_fn, service_fn}, 8 | Body, Response, Server, 9 | }; 10 | 11 | fn main() -> Result<(), Box> { 12 | tokio::runtime::Builder::new_current_thread() 13 | .enable_all() 14 | .build()? 15 | .block_on(async { 16 | let addr = SocketAddr::from((Ipv4Addr::LOCALHOST, 8000)); 17 | let make_service = make_service_fn(|_conn| async { 18 | Ok::<_, Infallible>(service_fn(|_req| async move { 19 | Ok::<_, Infallible>(Response::new(Body::from("Rust Bits!\n"))) 20 | })) 21 | }); 22 | 23 | Server::bind(&addr) 24 | .tcp_nodelay(true) 25 | .serve(make_service) 26 | .await 27 | .map_err(Into::into) 28 | }) 29 | } 30 | -------------------------------------------------------------------------------- /go-http-client/go-http-client.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "io/ioutil" 6 | "net" 7 | "net/http" 8 | "time" 9 | ) 10 | 11 | func main() { 12 | dialer := &net.Dialer{ 13 | Timeout: 30 * time.Second, 14 | KeepAlive: 30 * time.Second, 15 | } 16 | transport := &http.Transport{ 17 | DialContext: dialer.DialContext, 18 | } 19 | client := &http.Client{ 20 | Transport: transport, 21 | } 22 | 23 | for i := 0; i < 1000; i++ { 24 | req, err := http.NewRequest(http.MethodGet, "http://127.0.0.1:8000/get", nil) 25 | if err != nil { 26 | fmt.Println("Error creating GET request:", err) 27 | return 28 | } 29 | 30 | req.Header.Add("Connection", "keep-alive") 31 | 32 | resp, err := client.Do(req) 33 | if err != nil { 34 | fmt.Println("Error sending GET request:", err) 35 | return 36 | } 37 | defer resp.Body.Close() 38 | 39 | body, err := ioutil.ReadAll(resp.Body) 40 | if err != nil { 41 | fmt.Println("Error reading response:", err) 42 | return 43 | } 44 | 45 | fmt.Println(i+1, string(body)) 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2023 Orhun Parmaksız 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /cpp-asio-httpclient/build.zig: -------------------------------------------------------------------------------- 1 | const std = @import("std"); 2 | 3 | pub fn build(b: *std.Build) void { 4 | const target = b.standardTargetOptions(.{}); 5 | const optimize = b.standardOptimizeOption(.{}); 6 | 7 | const libasio_dep = b.dependency("asio", .{ 8 | .target = target, 9 | .optimize = optimize, 10 | }); 11 | const libasio = libasio_dep.artifact("asio"); 12 | 13 | const exe = b.addExecutable(.{ 14 | .name = "cpp-asio-httpclient", 15 | .target = target, 16 | .optimize = optimize, 17 | }); 18 | // get include to zig-cache/i/{hash-pkg}/include 19 | for (libasio.include_dirs.items) |include| { 20 | exe.include_dirs.append(include) catch {}; 21 | } 22 | exe.addCSourceFile(.{ 23 | .file = .{ 24 | .path = "src/main.cpp", 25 | }, 26 | .flags = &.{ 27 | "-Wall", 28 | "-Wextra", 29 | "-Wshadow", 30 | }, 31 | }); 32 | exe.linkLibrary(libasio); 33 | exe.linkLibCpp(); 34 | 35 | b.installArtifact(exe); 36 | 37 | const run_cmd = b.addRunArtifact(exe); 38 | run_cmd.step.dependOn(b.getInstallStep()); 39 | 40 | if (b.args) |args| { 41 | run_cmd.addArgs(args); 42 | } 43 | 44 | const run_step = b.step("run", "Run the app"); 45 | run_step.dependOn(&run_cmd.step); 46 | } 47 | -------------------------------------------------------------------------------- /rust-hyper/src/main.rs: -------------------------------------------------------------------------------- 1 | use std::{ 2 | io::{stdout, Write}, 3 | time::Duration, 4 | }; 5 | 6 | use hyper::{ 7 | body::Buf, 8 | client::{Client, HttpConnector}, 9 | Body, Request, Uri, 10 | }; 11 | 12 | fn main() -> Result<(), Box> { 13 | tokio::runtime::Builder::new_current_thread() 14 | .enable_all() 15 | .build()? 16 | .block_on(async { 17 | let client = Client::builder().build::<_, Body>({ 18 | let mut conn = HttpConnector::new(); 19 | conn.set_nodelay(true); 20 | conn.set_keepalive(Some(Duration::from_secs(30))); 21 | conn 22 | }); 23 | let uri = "http://127.0.0.1:8000/get".parse::()?; 24 | 25 | for i in 1..=1000 { 26 | let response = client 27 | .request( 28 | Request::get(&uri) 29 | .header("connection", "keep-alive") 30 | .body(Body::empty())?, 31 | ) 32 | .await?; 33 | let body = hyper::body::aggregate(response.into_body()).await?; 34 | 35 | let mut stdout = stdout().lock(); 36 | write!(&mut stdout, "{i} ")?; 37 | 38 | std::io::copy(&mut body.reader(), &mut stdout)?; 39 | 40 | stdout.write_all(b"\n")?; 41 | stdout.flush()?; 42 | } 43 | 44 | Ok(()) 45 | }) 46 | } 47 | -------------------------------------------------------------------------------- /cpp-asio-httpserver/build.zig: -------------------------------------------------------------------------------- 1 | const std = @import("std"); 2 | 3 | pub fn build(b: *std.Build) void { 4 | const target = b.standardTargetOptions(.{}); 5 | const optimize = b.standardOptimizeOption(.{}); 6 | 7 | // Standalone-Server uses asio (standalone/non-boost) 8 | const libasio_dep = b.dependency("standaloneServer", .{ 9 | .target = target, 10 | .optimize = optimize, 11 | }); 12 | const libasio = libasio_dep.artifact("Standalone-server"); 13 | 14 | const exe = b.addExecutable(.{ 15 | .name = "cpp-asio-httpserver", 16 | .target = target, 17 | .optimize = optimize, 18 | }); 19 | // get include to zig-cache/i/{hash-pkg}/include 20 | for (libasio.include_dirs.items) |include| { 21 | exe.include_dirs.append(include) catch {}; 22 | } 23 | exe.addCSourceFile(.{ 24 | .file = .{ 25 | .path = "src/main.cpp", 26 | }, 27 | .flags = &.{ 28 | "-Wall", 29 | "-Wextra", 30 | "-Wshadow", 31 | }, 32 | }); 33 | // use standalone asio - non-boost 34 | exe.defineCMacro("ASIO_STANDALONE", null); 35 | exe.linkLibrary(libasio); 36 | exe.linkLibCpp(); 37 | 38 | b.installArtifact(exe); 39 | 40 | const run_cmd = b.addRunArtifact(exe); 41 | run_cmd.step.dependOn(b.getInstallStep()); 42 | 43 | if (b.args) |args| { 44 | run_cmd.addArgs(args); 45 | } 46 | 47 | const run_step = b.step("run", b.fmt("Run the {s} app", .{exe.name})); 48 | run_step.dependOn(&run_cmd.step); 49 | } 50 | -------------------------------------------------------------------------------- /zig-http-client/src/main.zig: -------------------------------------------------------------------------------- 1 | // Zig version: 0.11.0 2 | 3 | const std = @import("std"); 4 | const http = std.http; 5 | 6 | pub fn main() !void { 7 | // Create an allocator. 8 | var gpa = std.heap.GeneralPurposeAllocator(.{}){}; 9 | const allocator = gpa.allocator(); 10 | 11 | // Create an HTTP client. 12 | var client = http.Client{ .allocator = allocator }; 13 | // Release all associated resources with the client. 14 | defer client.deinit(); 15 | 16 | // Parse the URI. 17 | const uri = std.Uri.parse("http://127.0.0.1:8000/get") catch unreachable; 18 | 19 | // Create the headers that will be sent to the server. 20 | var headers = std.http.Headers{ .allocator = allocator }; 21 | defer headers.deinit(); 22 | 23 | // Accept anything. 24 | try headers.append("accept", "*/*"); 25 | // Enable connection keep-alive. 26 | try headers.append("connection", "keep-alive"); 27 | 28 | var i: usize = 0; 29 | 30 | while (i < 1000) : (i += 1) { 31 | // Make the connection to the server. 32 | var request = try client.request(.GET, uri, headers, .{}); 33 | defer request.deinit(); 34 | 35 | // Send the request and headers to the server. 36 | try request.start(); 37 | 38 | // Wait for the server to send use a response 39 | try request.wait(); 40 | 41 | // Read the entire response body, but only allow it to allocate 8KB of memory. 42 | const body = request.reader().readAllAlloc(allocator, 8192) catch unreachable; 43 | defer allocator.free(body); 44 | 45 | // Print out the response. 46 | const stdout = std.io.getStdOut().writer(); 47 | try stdout.print("{} {s}\n", .{i, body}); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /git-yolo/src/main.zig: -------------------------------------------------------------------------------- 1 | const std = @import("std"); 2 | const http = std.http; 3 | 4 | // URL for fetching a random message. 5 | const RANDOM_MESSAGE_URL = "https://whatthecommit.com/index.txt"; 6 | 7 | /// Returns a random message. 8 | fn getRandomMessage(allocator: std.mem.Allocator) ![]u8 { 9 | // Create an HTTP client. 10 | var client = http.Client{ .allocator = allocator }; 11 | // Release all associated resources with the client. 12 | defer client.deinit(); 13 | // Parse the URI. 14 | const uri = try std.Uri.parse(RANDOM_MESSAGE_URL); 15 | // Create the headers that will be sent to the server. 16 | var headers = std.http.Headers{ .allocator = allocator }; 17 | defer headers.deinit(); 18 | // Accept anything. 19 | try headers.append("accept", "*/*"); 20 | // Make the connection to the server. 21 | var request = try client.request(.GET, uri, headers, .{}); 22 | defer request.deinit(); 23 | // Send the request and headers to the server. 24 | try request.start(); 25 | // Wait for the server to send use a response 26 | try request.wait(); 27 | // Return the body. 28 | return try request.reader().readAllAlloc(allocator, 8192); 29 | } 30 | 31 | /// Executes the `git commit` command with the given message parameter. 32 | fn commit(allocator: std.mem.Allocator, message: []const u8) !void { 33 | var process = std.ChildProcess.init(&[_][]const u8{ 34 | "git", 35 | "commit", 36 | "-m", 37 | message, 38 | }, allocator); 39 | try process.spawn(); 40 | } 41 | 42 | /// Entry-point of the application. 43 | pub fn main() !void { 44 | // Create an allocator. 45 | var gpa = std.heap.GeneralPurposeAllocator(.{}){}; 46 | const allocator = gpa.allocator(); 47 | // Get a random message. 48 | var message = try getRandomMessage(allocator); 49 | defer allocator.free(message); 50 | // Create a git commit. 51 | try commit(allocator, message); 52 | } 53 | -------------------------------------------------------------------------------- /.github/workflows/benchmark.yml: -------------------------------------------------------------------------------- 1 | name: Benchmark 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | pull_request: 8 | workflow_dispatch: 9 | schedule: 10 | - cron: "0 0 * * 0" 11 | 12 | jobs: 13 | bench: 14 | runs-on: ubuntu-latest 15 | steps: 16 | - name: Checkout 17 | uses: actions/checkout@v3 18 | 19 | - name: Install cargo-binstall 20 | uses: cargo-bins/cargo-binstall@main 21 | 22 | - name: Install Hyperfine 23 | run: cargo binstall -y hyperfine 24 | 25 | - name: Install Zig 26 | uses: goto-bus-stop/setup-zig@v2 27 | 28 | - name: Run benchmarks 29 | shell: bash 30 | run: ./bench.sh 31 | 32 | - name: Generate plot 33 | shell: bash 34 | run: | 35 | wget https://raw.githubusercontent.com/orhun/zig-http-benchmarks/output/plot_whisker.py 36 | python -m pip install -U matplotlib 37 | python plot_whisker.py benchmarks.json -o benchmarks.png 38 | 39 | - name: Upload output 40 | uses: actions/upload-artifact@v3 41 | with: 42 | name: benchmark-output 43 | path: benchmarks.* 44 | 45 | - name: Checkout output branch 46 | uses: actions/checkout@v3 47 | if: github.event_name != 'pull_request' 48 | with: 49 | ref: output 50 | fetch-depth: 1 51 | 52 | - name: Download output 53 | uses: actions/download-artifact@v3 54 | if: github.event_name != 'pull_request' 55 | with: 56 | name: benchmark-output 57 | 58 | - name: Update the plot 59 | run: | 60 | cargo binstall -y menyoki 61 | menyoki edit --invert benchmarks.png save benchmarks-bw.png 62 | 63 | - name: Commit to the branch 64 | if: github.event_name != 'pull_request' 65 | shell: bash 66 | run: | 67 | git config user.name 'github-actions[bot]' 68 | git config user.email 'github-actions[bot]@users.noreply.github.com' 69 | set +e 70 | git add benchmarks* 71 | git commit -m "Update benchmarks" 72 | git push https://${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git output 73 | -------------------------------------------------------------------------------- /zig-http-client/build.zig: -------------------------------------------------------------------------------- 1 | const std = @import("std"); 2 | 3 | // Although this function looks imperative, note that its job is to 4 | // declaratively construct a build graph that will be executed by an external 5 | // runner. 6 | pub fn build(b: *std.Build) void { 7 | // Standard target options allows the person running `zig build` to choose 8 | // what target to build for. Here we do not override the defaults, which 9 | // means any target is allowed, and the default is native. Other options 10 | // for restricting supported target set are available. 11 | const target = b.standardTargetOptions(.{}); 12 | 13 | // Standard optimization options allow the person running `zig build` to select 14 | // between Debug, ReleaseSafe, ReleaseFast, and ReleaseSmall. Here we do not 15 | // set a preferred release mode, allowing the user to decide how to optimize. 16 | const optimize = b.standardOptimizeOption(.{}); 17 | 18 | const exe = b.addExecutable(.{ 19 | .name = "zig-http-client", 20 | // In this case the main source file is merely a path, however, in more 21 | // complicated build scripts, this could be a generated file. 22 | .root_source_file = .{ .path = "src/main.zig" }, 23 | .target = target, 24 | .optimize = optimize, 25 | }); 26 | 27 | // This declares intent for the executable to be installed into the 28 | // standard location when the user invokes the "install" step (the default 29 | // step when running `zig build`). 30 | b.installArtifact(exe); 31 | 32 | // This *creates* a Run step in the build graph, to be executed when another 33 | // step is evaluated that depends on it. The next line below will establish 34 | // such a dependency. 35 | const run_cmd = b.addRunArtifact(exe); 36 | 37 | // By making the run step depend on the install step, it will be run from the 38 | // installation directory rather than directly from within the cache directory. 39 | // This is not necessary, however, if the application depends on other installed 40 | // files, this ensures they will be present and in the expected location. 41 | run_cmd.step.dependOn(b.getInstallStep()); 42 | 43 | // This allows the user to pass arguments to the application in the build 44 | // command itself, like this: `zig build run -- arg1 arg2 etc` 45 | if (b.args) |args| { 46 | run_cmd.addArgs(args); 47 | } 48 | 49 | // This creates a build step. It will be visible in the `zig build --help` menu, 50 | // and can be selected like this: `zig build run` 51 | // This will evaluate the `run` step rather than the default, which is "install". 52 | const run_step = b.step("run", "Run the app"); 53 | run_step.dependOn(&run_cmd.step); 54 | } 55 | -------------------------------------------------------------------------------- /zig-http-server/build.zig: -------------------------------------------------------------------------------- 1 | const std = @import("std"); 2 | 3 | // Although this function looks imperative, note that its job is to 4 | // declaratively construct a build graph that will be executed by an external 5 | // runner. 6 | pub fn build(b: *std.Build) void { 7 | // Standard target options allows the person running `zig build` to choose 8 | // what target to build for. Here we do not override the defaults, which 9 | // means any target is allowed, and the default is native. Other options 10 | // for restricting supported target set are available. 11 | const target = b.standardTargetOptions(.{}); 12 | 13 | // Standard optimization options allow the person running `zig build` to select 14 | // between Debug, ReleaseSafe, ReleaseFast, and ReleaseSmall. Here we do not 15 | // set a preferred release mode, allowing the user to decide how to optimize. 16 | const optimize = b.standardOptimizeOption(.{}); 17 | 18 | const exe = b.addExecutable(.{ 19 | .name = "zig-http-server", 20 | // In this case the main source file is merely a path, however, in more 21 | // complicated build scripts, this could be a generated file. 22 | .root_source_file = .{ .path = "src/main.zig" }, 23 | .target = target, 24 | .optimize = optimize, 25 | }); 26 | 27 | // This declares intent for the executable to be installed into the 28 | // standard location when the user invokes the "install" step (the default 29 | // step when running `zig build`). 30 | b.installArtifact(exe); 31 | 32 | // This *creates* a Run step in the build graph, to be executed when another 33 | // step is evaluated that depends on it. The next line below will establish 34 | // such a dependency. 35 | const run_cmd = b.addRunArtifact(exe); 36 | 37 | // By making the run step depend on the install step, it will be run from the 38 | // installation directory rather than directly from within the cache directory. 39 | // This is not necessary, however, if the application depends on other installed 40 | // files, this ensures they will be present and in the expected location. 41 | run_cmd.step.dependOn(b.getInstallStep()); 42 | 43 | // This allows the user to pass arguments to the application in the build 44 | // command itself, like this: `zig build run -- arg1 arg2 etc` 45 | if (b.args) |args| { 46 | run_cmd.addArgs(args); 47 | } 48 | 49 | // This creates a build step. It will be visible in the `zig build --help` menu, 50 | // and can be selected like this: `zig build run` 51 | // This will evaluate the `run` step rather than the default, which is "install". 52 | const run_step = b.step("run", "Run the app"); 53 | run_step.dependOn(&run_cmd.step); 54 | } 55 | -------------------------------------------------------------------------------- /bench.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | cpwd="$(pwd)" 4 | required_bins=('zig' 'cargo' 'go' 'python' 'hyperfine') 5 | zig_bins=('zig-http-server' 'zig-http-client') 6 | rust_bins=('rust-http-server' 'rust-attohttpc' 'rust-hyper' 'rust-reqwest' 'rust-ureq') 7 | cpp_bins=('cpp-asio-httpserver' 'cpp-asio-httpclient') 8 | go_bins=('go-http-client') 9 | python_bins=('python-http-client') 10 | 11 | for required_bin in "${required_bins[@]}"; do 12 | if ! command -v "${required_bin}" &>/dev/null; then 13 | echo "$required_bin is not installed!" 14 | exit 1 15 | fi 16 | done 17 | 18 | for zig_bin in "${zig_bins[@]}"; do 19 | echo "Building ${zig_bin}..." 20 | cd "${cpwd}/${zig_bin}" || exit 21 | zig build -Doptimize=ReleaseFast 22 | done 23 | 24 | for rust_bin in "${rust_bins[@]}"; do 25 | echo "Building ${rust_bin}..." 26 | cargo build --release --manifest-path "${cpwd}/${rust_bin}/Cargo.toml" 27 | done 28 | 29 | for cpp_bin in "${cpp_bins[@]}"; do 30 | echo "Building ${cpp_bin}..." 31 | cd "${cpwd}/${cpp_bin}" || exit 32 | zig build -Doptimize=ReleaseFast 33 | done 34 | 35 | for go_bin in "${go_bins[@]}"; do 36 | echo "Building ${go_bin}..." 37 | cd "${cpwd}/${go_bin}" || exit 38 | go build "${go_bin}.go" 39 | done 40 | 41 | cd "${cpwd}" || exit 42 | server_bins=( 43 | "${zig_bins[0]}/zig-out/bin/${zig_bins[0]}" 44 | "${rust_bins[0]}/target/release/${rust_bins[0]}" 45 | "${cpp_bins[0]}/zig-out/bin/${cpp_bins[0]}" 46 | ) 47 | echo "Running the server..." 48 | "${cpwd}/${server_bins[0]}" & 49 | SERVER_PID=$! 50 | trap 'kill -9 $SERVER_PID' SIGINT SIGTERM 51 | 52 | args=( 53 | "--warmup" "10" 54 | "--runs" "100" 55 | "-N" 56 | "--command-name" "curl" 57 | "--command-name" "zig-http-client" 58 | "--command-name" "rust-attohttpc" 59 | "--command-name" "rust-hyper" 60 | "--command-name" "rust-reqwest" 61 | "--command-name" "rust-ureq" 62 | "--command-name" "go-http-client" 63 | "--command-name" "python-http-client" 64 | "--command-name" "cpp-asio-httpclient" 65 | ) 66 | 67 | commands=("curl -H 'Accept-Encoding: gzip' 'http://127.0.0.1:8000/get?range=1-1000'") 68 | 69 | for zig_bin in "${zig_bins[@]:1}"; do 70 | commands+=("${cpwd}/${zig_bin}/zig-out/bin/${zig_bin}") 71 | done 72 | 73 | for rust_bin in "${rust_bins[@]:1}"; do 74 | commands+=("${cpwd}/${rust_bin}/target/release/${rust_bin}") 75 | done 76 | 77 | for go_bin in "${go_bins[@]}"; do 78 | commands+=("${cpwd}/${go_bin}/${go_bin}") 79 | done 80 | 81 | for python_bin in "${python_bins[@]}"; do 82 | commands+=("python ${cpwd}/${python_bin}/${python_bin}.py") 83 | done 84 | 85 | for cpp_bin in "${cpp_bins[@]:1}"; do 86 | commands+=("${cpwd}/${cpp_bin}/zig-out/bin/${cpp_bin}") 87 | done 88 | 89 | hyperfine "${args[@]}" "${commands[@]}" -i --export-json benchmarks.json --export-markdown benchmarks.md 90 | sed -i "s|$cpwd\/||g" benchmarks.* 91 | 92 | kill -9 "$SERVER_PID" 93 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## `zig-http-benchmarks` ⚡ 2 | 3 | Read the blog post: [**Zig Bits 0x4**](https://blog.orhun.dev/zig-bits-04/) 4 | 5 | This repository contains a HTTP server/client implementation using Zig's standard library and benchmarks for comparing the client's performance with implementations in other programming languages such as Rust and Go. 6 | 7 | ### Prerequisites 8 | 9 | - Zig (`>=0.11`), Rust/Cargo, Go, Python 10 | - [Hyperfine](https://github.com/sharkdp/hyperfine) (for benchmarking) 11 | 12 | ### Benchmarking 13 | 14 | To run the benchmarks: 15 | 16 | ```sh 17 | chmod +x bench.sh 18 | ./bench.sh 19 | ``` 20 | 21 | The result will be saved to `benchmarks.md` and `benchmarks.json`. 22 | 23 | ``` 24 | rust-hyper ran 25 | 1.01 ± 0.02 times faster than rust-ureq 26 | 1.01 ± 0.02 times faster than rust-reqwest 27 | 1.24 ± 0.06 times faster than go-http-client 28 | 1.46 ± 0.05 times faster than rust-attohttpc 29 | 2.03 ± 0.05 times faster than zig-http-client 30 | 4.26 ± 0.12 times faster than curl 31 | 8.57 ± 0.12 times faster than python-http-client 32 | 19.93 ± 0.25 times faster than cpp-asio-httpclient 33 | ``` 34 | 35 | | Command | Mean [ms] | Min [ms] | Max [ms] | Relative | 36 | | :-------------------- | -----------: | -------: | -------: | -----------: | 37 | | `curl` | 457.9 ± 11.2 | 442.4 | 522.2 | 4.26 ± 0.12 | 38 | | `zig-http-client` | 218.5 ± 4.8 | 210.3 | 240.3 | 2.03 ± 0.05 | 39 | | `rust-attohttpc` | 157.2 ± 5.3 | 151.8 | 190.4 | 1.46 ± 0.05 | 40 | | `rust-hyper` | 107.6 ± 1.3 | 104.4 | 114.8 | 1.00 | 41 | | `rust-reqwest` | 108.7 ± 2.2 | 105.4 | 123.7 | 1.01 ± 0.02 | 42 | | `rust-ureq` | 108.4 ± 2.3 | 105.7 | 123.1 | 1.01 ± 0.02 | 43 | | `go-http-client` | 133.1 ± 6.2 | 127.6 | 159.2 | 1.24 ± 0.06 | 44 | | `python-http-client` | 921.9 ± 5.9 | 911.4 | 947.1 | 8.57 ± 0.12 | 45 | | `cpp-asio-httpclient` | 2144.5 ± 4.5 | 2133.0 | 2168.2 | 19.93 ± 0.25 | 46 | 47 | ### Plotting 48 | 49 | Use the [JSON data](https://github.com/sharkdp/hyperfine#json) along with the [scripts](https://github.com/sharkdp/hyperfine/tree/master/scripts) from the `hyperfine` examples to plot data using [`matplotlib`](https://matplotlib.org/). For example: 50 | 51 | ```sh 52 | git clone --depth 1 https://github.com/sharkdp/hyperfine 53 | python hyperfine/scripts/plot_whisker.py benchmarks.json 54 | ``` 55 | 56 | ![plot_whisker](https://raw.githubusercontent.com/orhun/zig-http-benchmarks/output/benchmarks.png) 57 | 58 | ### Environment 59 | 60 | The results are coming from a GitHub runner (`ubuntu-latest`) and automated with [this workflow](https://github.com/orhun/zig-http-benchmarks/blob/master/.github/workflows/benchmark.yml). 61 | 62 | To see the output for the latest run, check out the [`output`](https://github.com/orhun/zig-http-benchmarks/tree/output) branch in this repository. 63 | 64 | ### License 65 | 66 | 67 | Licensed under The MIT License. 68 | 69 | -------------------------------------------------------------------------------- /rust-ureq/Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 3 4 | 5 | [[package]] 6 | name = "base64" 7 | version = "0.21.2" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d" 10 | 11 | [[package]] 12 | name = "form_urlencoded" 13 | version = "1.2.0" 14 | source = "registry+https://github.com/rust-lang/crates.io-index" 15 | checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" 16 | dependencies = [ 17 | "percent-encoding", 18 | ] 19 | 20 | [[package]] 21 | name = "idna" 22 | version = "0.4.0" 23 | source = "registry+https://github.com/rust-lang/crates.io-index" 24 | checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" 25 | dependencies = [ 26 | "unicode-bidi", 27 | "unicode-normalization", 28 | ] 29 | 30 | [[package]] 31 | name = "log" 32 | version = "0.4.19" 33 | source = "registry+https://github.com/rust-lang/crates.io-index" 34 | checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4" 35 | 36 | [[package]] 37 | name = "once_cell" 38 | version = "1.18.0" 39 | source = "registry+https://github.com/rust-lang/crates.io-index" 40 | checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" 41 | 42 | [[package]] 43 | name = "percent-encoding" 44 | version = "2.3.0" 45 | source = "registry+https://github.com/rust-lang/crates.io-index" 46 | checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" 47 | 48 | [[package]] 49 | name = "rust-ureq" 50 | version = "0.1.0" 51 | dependencies = [ 52 | "ureq", 53 | ] 54 | 55 | [[package]] 56 | name = "tinyvec" 57 | version = "1.6.0" 58 | source = "registry+https://github.com/rust-lang/crates.io-index" 59 | checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" 60 | dependencies = [ 61 | "tinyvec_macros", 62 | ] 63 | 64 | [[package]] 65 | name = "tinyvec_macros" 66 | version = "0.1.1" 67 | source = "registry+https://github.com/rust-lang/crates.io-index" 68 | checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" 69 | 70 | [[package]] 71 | name = "unicode-bidi" 72 | version = "0.3.13" 73 | source = "registry+https://github.com/rust-lang/crates.io-index" 74 | checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" 75 | 76 | [[package]] 77 | name = "unicode-normalization" 78 | version = "0.1.22" 79 | source = "registry+https://github.com/rust-lang/crates.io-index" 80 | checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" 81 | dependencies = [ 82 | "tinyvec", 83 | ] 84 | 85 | [[package]] 86 | name = "ureq" 87 | version = "2.7.1" 88 | source = "registry+https://github.com/rust-lang/crates.io-index" 89 | checksum = "0b11c96ac7ee530603dcdf68ed1557050f374ce55a5a07193ebf8cbc9f8927e9" 90 | dependencies = [ 91 | "base64", 92 | "log", 93 | "once_cell", 94 | "url", 95 | ] 96 | 97 | [[package]] 98 | name = "url" 99 | version = "2.4.0" 100 | source = "registry+https://github.com/rust-lang/crates.io-index" 101 | checksum = "50bff7831e19200a85b17131d085c25d7811bc4e186efdaf54bbd132994a88cb" 102 | dependencies = [ 103 | "form_urlencoded", 104 | "idna", 105 | "percent-encoding", 106 | ] 107 | -------------------------------------------------------------------------------- /git-yolo/build.zig: -------------------------------------------------------------------------------- 1 | const std = @import("std"); 2 | 3 | // Although this function looks imperative, note that its job is to 4 | // declaratively construct a build graph that will be executed by an external 5 | // runner. 6 | pub fn build(b: *std.Build) void { 7 | // Standard target options allows the person running `zig build` to choose 8 | // what target to build for. Here we do not override the defaults, which 9 | // means any target is allowed, and the default is native. Other options 10 | // for restricting supported target set are available. 11 | const target = b.standardTargetOptions(.{}); 12 | 13 | // Standard optimization options allow the person running `zig build` to select 14 | // between Debug, ReleaseSafe, ReleaseFast, and ReleaseSmall. Here we do not 15 | // set a preferred release mode, allowing the user to decide how to optimize. 16 | const optimize = b.standardOptimizeOption(.{}); 17 | 18 | const exe = b.addExecutable(.{ 19 | .name = "git-yolo", 20 | // In this case the main source file is merely a path, however, in more 21 | // complicated build scripts, this could be a generated file. 22 | .root_source_file = .{ .path = "src/main.zig" }, 23 | .target = target, 24 | .optimize = optimize, 25 | }); 26 | 27 | // This declares intent for the executable to be installed into the 28 | // standard location when the user invokes the "install" step (the default 29 | // step when running `zig build`). 30 | b.installArtifact(exe); 31 | 32 | // This *creates* a Run step in the build graph, to be executed when another 33 | // step is evaluated that depends on it. The next line below will establish 34 | // such a dependency. 35 | const run_cmd = b.addRunArtifact(exe); 36 | 37 | // By making the run step depend on the install step, it will be run from the 38 | // installation directory rather than directly from within the cache directory. 39 | // This is not necessary, however, if the application depends on other installed 40 | // files, this ensures they will be present and in the expected location. 41 | run_cmd.step.dependOn(b.getInstallStep()); 42 | 43 | // This allows the user to pass arguments to the application in the build 44 | // command itself, like this: `zig build run -- arg1 arg2 etc` 45 | if (b.args) |args| { 46 | run_cmd.addArgs(args); 47 | } 48 | 49 | // This creates a build step. It will be visible in the `zig build --help` menu, 50 | // and can be selected like this: `zig build run` 51 | // This will evaluate the `run` step rather than the default, which is "install". 52 | const run_step = b.step("run", "Run the app"); 53 | run_step.dependOn(&run_cmd.step); 54 | 55 | // Creates a step for unit testing. This only builds the test executable 56 | // but does not run it. 57 | const unit_tests = b.addTest(.{ 58 | .root_source_file = .{ .path = "src/main.zig" }, 59 | .target = target, 60 | .optimize = optimize, 61 | }); 62 | 63 | const run_unit_tests = b.addRunArtifact(unit_tests); 64 | 65 | // Similar to creating the run step earlier, this exposes a `test` step to 66 | // the `zig build --help` menu, providing a way for the user to request 67 | // running the unit tests. 68 | const test_step = b.step("test", "Run unit tests"); 69 | test_step.dependOn(&run_unit_tests.step); 70 | } 71 | -------------------------------------------------------------------------------- /cpp-asio-httpclient/src/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | using asio::ip::tcp; 9 | 10 | class HttpClient { 11 | public: 12 | HttpClient(asio::io_context &ioContext) 13 | : ioContext_(ioContext), socket_(ioContext) {} 14 | 15 | void connect(const std::string &host, const std::string &port) { 16 | tcp::resolver resolver(ioContext_); 17 | endpoints_ = resolver.resolve(host, port); 18 | asio::connect(socket_, endpoints_); 19 | } 20 | 21 | void sendRequest(const std::string &request, 22 | std::function onResponse) { 23 | onResponse_ = std::move(onResponse); 24 | asio::async_write(socket_, asio::buffer(request), 25 | [this](std::error_code ec, std::size_t /*length*/) { 26 | if (!ec) { 27 | readResponse(); 28 | } else { 29 | std::cerr << "Write error: " << ec.message() 30 | << std::endl; 31 | } 32 | }); 33 | } 34 | 35 | void readResponse() { 36 | asio::async_read_until(socket_, responseBuffer_, "\r\n\r\n", 37 | [this](std::error_code ec, std::size_t /*length*/) { 38 | if (!ec) { 39 | processResponse(); 40 | } else { 41 | std::cerr << "Read error: " << ec.message() 42 | << std::endl; 43 | } 44 | }); 45 | } 46 | 47 | void processResponse() { 48 | std::istream responseStream(&responseBuffer_); 49 | 50 | std::string header; 51 | while (std::getline(responseStream, header) && header != "\r") { 52 | std::cout << header << std::endl; 53 | } 54 | 55 | std::ostringstream contentStream; 56 | if (responseBuffer_.size() > 0) { 57 | contentStream << &responseBuffer_; 58 | onResponse_(contentStream.str()); 59 | } 60 | 61 | socket_.close(); 62 | } 63 | 64 | private: 65 | asio::io_context &ioContext_; 66 | tcp::socket socket_; 67 | tcp::resolver::results_type endpoints_; 68 | asio::streambuf responseBuffer_; 69 | std::function onResponse_; 70 | }; 71 | 72 | int main() { 73 | try { 74 | asio::io_context ioContext; 75 | 76 | const std::string host = "localhost"; 77 | const std::string port = "8000"; 78 | 79 | std::vector> clients; 80 | std::vector responses; 81 | 82 | for (int i = 0; i < 1000; ++i) { 83 | clients.emplace_back(std::make_unique(ioContext)); 84 | clients.back()->connect(host, port); 85 | clients.back()->sendRequest( 86 | "GET /get HTTP/1.1\r\n" 87 | "Host: localhost\r\n" 88 | "Connection: close\r\n" 89 | "\r\n", 90 | [&](const std::string &response) { responses.push_back(response); }); 91 | } 92 | 93 | ioContext.run(); 94 | 95 | // Process responses as needed 96 | for (const auto &response : responses) { 97 | std::cout << "Response Content: " << response << std::endl; 98 | } 99 | } catch (const std::exception &e) { 100 | std::cerr << "Error: " << e.what() << std::endl; 101 | } 102 | 103 | return 0; 104 | } 105 | -------------------------------------------------------------------------------- /rust-attohttpc/Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 3 4 | 5 | [[package]] 6 | name = "attohttpc" 7 | version = "0.25.0" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "7e57d6e7a84f33ff3316e97af3180fe7f86597a6a60161c0be70c0e45f382620" 10 | dependencies = [ 11 | "http", 12 | "log", 13 | "url", 14 | ] 15 | 16 | [[package]] 17 | name = "bytes" 18 | version = "1.4.0" 19 | source = "registry+https://github.com/rust-lang/crates.io-index" 20 | checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" 21 | 22 | [[package]] 23 | name = "fnv" 24 | version = "1.0.7" 25 | source = "registry+https://github.com/rust-lang/crates.io-index" 26 | checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" 27 | 28 | [[package]] 29 | name = "form_urlencoded" 30 | version = "1.2.0" 31 | source = "registry+https://github.com/rust-lang/crates.io-index" 32 | checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" 33 | dependencies = [ 34 | "percent-encoding", 35 | ] 36 | 37 | [[package]] 38 | name = "http" 39 | version = "0.2.9" 40 | source = "registry+https://github.com/rust-lang/crates.io-index" 41 | checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" 42 | dependencies = [ 43 | "bytes", 44 | "fnv", 45 | "itoa", 46 | ] 47 | 48 | [[package]] 49 | name = "idna" 50 | version = "0.4.0" 51 | source = "registry+https://github.com/rust-lang/crates.io-index" 52 | checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" 53 | dependencies = [ 54 | "unicode-bidi", 55 | "unicode-normalization", 56 | ] 57 | 58 | [[package]] 59 | name = "itoa" 60 | version = "1.0.9" 61 | source = "registry+https://github.com/rust-lang/crates.io-index" 62 | checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" 63 | 64 | [[package]] 65 | name = "log" 66 | version = "0.4.19" 67 | source = "registry+https://github.com/rust-lang/crates.io-index" 68 | checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4" 69 | 70 | [[package]] 71 | name = "percent-encoding" 72 | version = "2.3.0" 73 | source = "registry+https://github.com/rust-lang/crates.io-index" 74 | checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" 75 | 76 | [[package]] 77 | name = "rust-attohttpc" 78 | version = "0.1.0" 79 | dependencies = [ 80 | "attohttpc", 81 | ] 82 | 83 | [[package]] 84 | name = "tinyvec" 85 | version = "1.6.0" 86 | source = "registry+https://github.com/rust-lang/crates.io-index" 87 | checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" 88 | dependencies = [ 89 | "tinyvec_macros", 90 | ] 91 | 92 | [[package]] 93 | name = "tinyvec_macros" 94 | version = "0.1.1" 95 | source = "registry+https://github.com/rust-lang/crates.io-index" 96 | checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" 97 | 98 | [[package]] 99 | name = "unicode-bidi" 100 | version = "0.3.13" 101 | source = "registry+https://github.com/rust-lang/crates.io-index" 102 | checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" 103 | 104 | [[package]] 105 | name = "unicode-normalization" 106 | version = "0.1.22" 107 | source = "registry+https://github.com/rust-lang/crates.io-index" 108 | checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" 109 | dependencies = [ 110 | "tinyvec", 111 | ] 112 | 113 | [[package]] 114 | name = "url" 115 | version = "2.4.0" 116 | source = "registry+https://github.com/rust-lang/crates.io-index" 117 | checksum = "50bff7831e19200a85b17131d085c25d7811bc4e186efdaf54bbd132994a88cb" 118 | dependencies = [ 119 | "form_urlencoded", 120 | "idna", 121 | "percent-encoding", 122 | ] 123 | -------------------------------------------------------------------------------- /zig-http-server/src/main.zig: -------------------------------------------------------------------------------- 1 | const std = @import("std"); 2 | const http = std.http; 3 | const log = std.log.scoped(.server); 4 | 5 | const server_addr = "127.0.0.1"; 6 | const server_port = 8000; 7 | 8 | // Run the server and handle incoming requests. 9 | fn runServer(server: *http.Server, allocator: std.mem.Allocator) !void { 10 | outer: while (true) { 11 | // Accept incoming connection. 12 | var response = try server.accept(.{ 13 | .allocator = allocator, 14 | }); 15 | defer response.deinit(); 16 | 17 | // Avoid Nagle's algorithm. 18 | // 19 | try std.os.setsockopt( 20 | response.connection.stream.handle, 21 | std.os.IPPROTO.TCP, 22 | std.os.TCP.NODELAY, 23 | &std.mem.toBytes(@as(c_int, 1)), 24 | ); 25 | 26 | while (response.reset() != .closing) { 27 | // Handle errors during request processing. 28 | response.wait() catch |err| switch (err) { 29 | error.HttpHeadersInvalid => continue :outer, 30 | error.EndOfStream => continue, 31 | else => return err, 32 | }; 33 | 34 | // Process the request. 35 | try handleRequest(&response, allocator); 36 | } 37 | } 38 | } 39 | 40 | // Handle an individual request. 41 | fn handleRequest(response: *http.Server.Response, allocator: std.mem.Allocator) !void { 42 | // Log the request details. 43 | log.info("{s} {s} {s}", .{ @tagName(response.request.method), @tagName(response.request.version), response.request.target }); 44 | 45 | // Read the request body. 46 | const body = try response.reader().readAllAlloc(allocator, 8192); 47 | defer allocator.free(body); 48 | 49 | // Set "connection" header to "keep-alive" if present in request headers. 50 | if (response.request.headers.contains("connection")) { 51 | try response.headers.append("connection", "keep-alive"); 52 | } 53 | 54 | // Check if the request target starts with "/get". 55 | if (std.mem.startsWith(u8, response.request.target, "/get")) { 56 | // Check if the request target contains "?chunked". 57 | if (std.mem.indexOf(u8, response.request.target, "?chunked") != null) { 58 | response.transfer_encoding = .chunked; 59 | } else { 60 | response.transfer_encoding = .{ .content_length = 10 }; 61 | } 62 | 63 | // Set "content-type" header to "text/plain". 64 | try response.headers.append("content-type", "text/plain"); 65 | 66 | // Write the response body. 67 | try response.do(); 68 | if (response.request.method != .HEAD) { 69 | try response.writeAll("Zig Bits!\n"); 70 | try response.finish(); 71 | } 72 | } else { 73 | // Set the response status to 404 (not found). 74 | response.status = .not_found; 75 | try response.do(); 76 | } 77 | } 78 | 79 | pub fn main() !void { 80 | // Create an allocator. 81 | var gpa = std.heap.GeneralPurposeAllocator(.{}){}; 82 | const allocator = gpa.allocator(); 83 | 84 | // Initialize the server. 85 | var server = http.Server.init(allocator, .{ .reuse_address = true }); 86 | defer server.deinit(); 87 | 88 | // Log the server address and port. 89 | log.info("Server is running at {s}:{d}", .{ server_addr, server_port }); 90 | 91 | // Parse the server address. 92 | const address = std.net.Address.parseIp(server_addr, server_port) catch unreachable; 93 | try server.listen(address); 94 | 95 | // Run the server. 96 | runServer(&server, allocator) catch |err| { 97 | // Handle server errors. 98 | log.err("server error: {}\n", .{err}); 99 | if (@errorReturnTrace()) |trace| { 100 | std.debug.dumpStackTrace(trace.*); 101 | } 102 | std.os.exit(1); 103 | }; 104 | } 105 | -------------------------------------------------------------------------------- /rust-hyper/Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 3 4 | 5 | [[package]] 6 | name = "addr2line" 7 | version = "0.20.0" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "f4fa78e18c64fce05e902adecd7a5eed15a5e0a3439f7b0e169f0252214865e3" 10 | dependencies = [ 11 | "gimli", 12 | ] 13 | 14 | [[package]] 15 | name = "adler" 16 | version = "1.0.2" 17 | source = "registry+https://github.com/rust-lang/crates.io-index" 18 | checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" 19 | 20 | [[package]] 21 | name = "autocfg" 22 | version = "1.1.0" 23 | source = "registry+https://github.com/rust-lang/crates.io-index" 24 | checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" 25 | 26 | [[package]] 27 | name = "backtrace" 28 | version = "0.3.68" 29 | source = "registry+https://github.com/rust-lang/crates.io-index" 30 | checksum = "4319208da049c43661739c5fade2ba182f09d1dc2299b32298d3a31692b17e12" 31 | dependencies = [ 32 | "addr2line", 33 | "cc", 34 | "cfg-if", 35 | "libc", 36 | "miniz_oxide", 37 | "object", 38 | "rustc-demangle", 39 | ] 40 | 41 | [[package]] 42 | name = "bytes" 43 | version = "1.4.0" 44 | source = "registry+https://github.com/rust-lang/crates.io-index" 45 | checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" 46 | 47 | [[package]] 48 | name = "cc" 49 | version = "1.0.79" 50 | source = "registry+https://github.com/rust-lang/crates.io-index" 51 | checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" 52 | 53 | [[package]] 54 | name = "cfg-if" 55 | version = "1.0.0" 56 | source = "registry+https://github.com/rust-lang/crates.io-index" 57 | checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" 58 | 59 | [[package]] 60 | name = "fnv" 61 | version = "1.0.7" 62 | source = "registry+https://github.com/rust-lang/crates.io-index" 63 | checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" 64 | 65 | [[package]] 66 | name = "futures-channel" 67 | version = "0.3.28" 68 | source = "registry+https://github.com/rust-lang/crates.io-index" 69 | checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" 70 | dependencies = [ 71 | "futures-core", 72 | ] 73 | 74 | [[package]] 75 | name = "futures-core" 76 | version = "0.3.28" 77 | source = "registry+https://github.com/rust-lang/crates.io-index" 78 | checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" 79 | 80 | [[package]] 81 | name = "futures-task" 82 | version = "0.3.28" 83 | source = "registry+https://github.com/rust-lang/crates.io-index" 84 | checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" 85 | 86 | [[package]] 87 | name = "futures-util" 88 | version = "0.3.28" 89 | source = "registry+https://github.com/rust-lang/crates.io-index" 90 | checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" 91 | dependencies = [ 92 | "futures-core", 93 | "futures-task", 94 | "pin-project-lite", 95 | "pin-utils", 96 | ] 97 | 98 | [[package]] 99 | name = "gimli" 100 | version = "0.27.3" 101 | source = "registry+https://github.com/rust-lang/crates.io-index" 102 | checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" 103 | 104 | [[package]] 105 | name = "http" 106 | version = "0.2.9" 107 | source = "registry+https://github.com/rust-lang/crates.io-index" 108 | checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" 109 | dependencies = [ 110 | "bytes", 111 | "fnv", 112 | "itoa", 113 | ] 114 | 115 | [[package]] 116 | name = "http-body" 117 | version = "0.4.5" 118 | source = "registry+https://github.com/rust-lang/crates.io-index" 119 | checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" 120 | dependencies = [ 121 | "bytes", 122 | "http", 123 | "pin-project-lite", 124 | ] 125 | 126 | [[package]] 127 | name = "httparse" 128 | version = "1.8.0" 129 | source = "registry+https://github.com/rust-lang/crates.io-index" 130 | checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" 131 | 132 | [[package]] 133 | name = "httpdate" 134 | version = "1.0.2" 135 | source = "registry+https://github.com/rust-lang/crates.io-index" 136 | checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" 137 | 138 | [[package]] 139 | name = "hyper" 140 | version = "0.14.27" 141 | source = "registry+https://github.com/rust-lang/crates.io-index" 142 | checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" 143 | dependencies = [ 144 | "bytes", 145 | "futures-channel", 146 | "futures-core", 147 | "futures-util", 148 | "http", 149 | "http-body", 150 | "httparse", 151 | "httpdate", 152 | "itoa", 153 | "pin-project-lite", 154 | "socket2", 155 | "tokio", 156 | "tower-service", 157 | "tracing", 158 | "want", 159 | ] 160 | 161 | [[package]] 162 | name = "itoa" 163 | version = "1.0.8" 164 | source = "registry+https://github.com/rust-lang/crates.io-index" 165 | checksum = "62b02a5381cc465bd3041d84623d0fa3b66738b52b8e2fc3bab8ad63ab032f4a" 166 | 167 | [[package]] 168 | name = "libc" 169 | version = "0.2.147" 170 | source = "registry+https://github.com/rust-lang/crates.io-index" 171 | checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" 172 | 173 | [[package]] 174 | name = "memchr" 175 | version = "2.5.0" 176 | source = "registry+https://github.com/rust-lang/crates.io-index" 177 | checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" 178 | 179 | [[package]] 180 | name = "miniz_oxide" 181 | version = "0.7.1" 182 | source = "registry+https://github.com/rust-lang/crates.io-index" 183 | checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" 184 | dependencies = [ 185 | "adler", 186 | ] 187 | 188 | [[package]] 189 | name = "mio" 190 | version = "0.8.8" 191 | source = "registry+https://github.com/rust-lang/crates.io-index" 192 | checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" 193 | dependencies = [ 194 | "libc", 195 | "wasi", 196 | "windows-sys", 197 | ] 198 | 199 | [[package]] 200 | name = "object" 201 | version = "0.31.1" 202 | source = "registry+https://github.com/rust-lang/crates.io-index" 203 | checksum = "8bda667d9f2b5051b8833f59f3bf748b28ef54f850f4fcb389a252aa383866d1" 204 | dependencies = [ 205 | "memchr", 206 | ] 207 | 208 | [[package]] 209 | name = "once_cell" 210 | version = "1.18.0" 211 | source = "registry+https://github.com/rust-lang/crates.io-index" 212 | checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" 213 | 214 | [[package]] 215 | name = "pin-project-lite" 216 | version = "0.2.10" 217 | source = "registry+https://github.com/rust-lang/crates.io-index" 218 | checksum = "4c40d25201921e5ff0c862a505c6557ea88568a4e3ace775ab55e93f2f4f9d57" 219 | 220 | [[package]] 221 | name = "pin-utils" 222 | version = "0.1.0" 223 | source = "registry+https://github.com/rust-lang/crates.io-index" 224 | checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" 225 | 226 | [[package]] 227 | name = "rust-hyper" 228 | version = "0.1.0" 229 | dependencies = [ 230 | "hyper", 231 | "tokio", 232 | ] 233 | 234 | [[package]] 235 | name = "rustc-demangle" 236 | version = "0.1.23" 237 | source = "registry+https://github.com/rust-lang/crates.io-index" 238 | checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" 239 | 240 | [[package]] 241 | name = "socket2" 242 | version = "0.4.9" 243 | source = "registry+https://github.com/rust-lang/crates.io-index" 244 | checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" 245 | dependencies = [ 246 | "libc", 247 | "winapi", 248 | ] 249 | 250 | [[package]] 251 | name = "tokio" 252 | version = "1.29.1" 253 | source = "registry+https://github.com/rust-lang/crates.io-index" 254 | checksum = "532826ff75199d5833b9d2c5fe410f29235e25704ee5f0ef599fb51c21f4a4da" 255 | dependencies = [ 256 | "autocfg", 257 | "backtrace", 258 | "libc", 259 | "mio", 260 | "pin-project-lite", 261 | "socket2", 262 | "windows-sys", 263 | ] 264 | 265 | [[package]] 266 | name = "tower-service" 267 | version = "0.3.2" 268 | source = "registry+https://github.com/rust-lang/crates.io-index" 269 | checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" 270 | 271 | [[package]] 272 | name = "tracing" 273 | version = "0.1.37" 274 | source = "registry+https://github.com/rust-lang/crates.io-index" 275 | checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" 276 | dependencies = [ 277 | "cfg-if", 278 | "pin-project-lite", 279 | "tracing-core", 280 | ] 281 | 282 | [[package]] 283 | name = "tracing-core" 284 | version = "0.1.31" 285 | source = "registry+https://github.com/rust-lang/crates.io-index" 286 | checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" 287 | dependencies = [ 288 | "once_cell", 289 | ] 290 | 291 | [[package]] 292 | name = "try-lock" 293 | version = "0.2.4" 294 | source = "registry+https://github.com/rust-lang/crates.io-index" 295 | checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" 296 | 297 | [[package]] 298 | name = "want" 299 | version = "0.3.1" 300 | source = "registry+https://github.com/rust-lang/crates.io-index" 301 | checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" 302 | dependencies = [ 303 | "try-lock", 304 | ] 305 | 306 | [[package]] 307 | name = "wasi" 308 | version = "0.11.0+wasi-snapshot-preview1" 309 | source = "registry+https://github.com/rust-lang/crates.io-index" 310 | checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" 311 | 312 | [[package]] 313 | name = "winapi" 314 | version = "0.3.9" 315 | source = "registry+https://github.com/rust-lang/crates.io-index" 316 | checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" 317 | dependencies = [ 318 | "winapi-i686-pc-windows-gnu", 319 | "winapi-x86_64-pc-windows-gnu", 320 | ] 321 | 322 | [[package]] 323 | name = "winapi-i686-pc-windows-gnu" 324 | version = "0.4.0" 325 | source = "registry+https://github.com/rust-lang/crates.io-index" 326 | checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 327 | 328 | [[package]] 329 | name = "winapi-x86_64-pc-windows-gnu" 330 | version = "0.4.0" 331 | source = "registry+https://github.com/rust-lang/crates.io-index" 332 | checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 333 | 334 | [[package]] 335 | name = "windows-sys" 336 | version = "0.48.0" 337 | source = "registry+https://github.com/rust-lang/crates.io-index" 338 | checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" 339 | dependencies = [ 340 | "windows-targets", 341 | ] 342 | 343 | [[package]] 344 | name = "windows-targets" 345 | version = "0.48.1" 346 | source = "registry+https://github.com/rust-lang/crates.io-index" 347 | checksum = "05d4b17490f70499f20b9e791dcf6a299785ce8af4d709018206dc5b4953e95f" 348 | dependencies = [ 349 | "windows_aarch64_gnullvm", 350 | "windows_aarch64_msvc", 351 | "windows_i686_gnu", 352 | "windows_i686_msvc", 353 | "windows_x86_64_gnu", 354 | "windows_x86_64_gnullvm", 355 | "windows_x86_64_msvc", 356 | ] 357 | 358 | [[package]] 359 | name = "windows_aarch64_gnullvm" 360 | version = "0.48.0" 361 | source = "registry+https://github.com/rust-lang/crates.io-index" 362 | checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" 363 | 364 | [[package]] 365 | name = "windows_aarch64_msvc" 366 | version = "0.48.0" 367 | source = "registry+https://github.com/rust-lang/crates.io-index" 368 | checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" 369 | 370 | [[package]] 371 | name = "windows_i686_gnu" 372 | version = "0.48.0" 373 | source = "registry+https://github.com/rust-lang/crates.io-index" 374 | checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" 375 | 376 | [[package]] 377 | name = "windows_i686_msvc" 378 | version = "0.48.0" 379 | source = "registry+https://github.com/rust-lang/crates.io-index" 380 | checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" 381 | 382 | [[package]] 383 | name = "windows_x86_64_gnu" 384 | version = "0.48.0" 385 | source = "registry+https://github.com/rust-lang/crates.io-index" 386 | checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" 387 | 388 | [[package]] 389 | name = "windows_x86_64_gnullvm" 390 | version = "0.48.0" 391 | source = "registry+https://github.com/rust-lang/crates.io-index" 392 | checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" 393 | 394 | [[package]] 395 | name = "windows_x86_64_msvc" 396 | version = "0.48.0" 397 | source = "registry+https://github.com/rust-lang/crates.io-index" 398 | checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" 399 | -------------------------------------------------------------------------------- /rust-http-server/Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 3 4 | 5 | [[package]] 6 | name = "addr2line" 7 | version = "0.20.0" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "f4fa78e18c64fce05e902adecd7a5eed15a5e0a3439f7b0e169f0252214865e3" 10 | dependencies = [ 11 | "gimli", 12 | ] 13 | 14 | [[package]] 15 | name = "adler" 16 | version = "1.0.2" 17 | source = "registry+https://github.com/rust-lang/crates.io-index" 18 | checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" 19 | 20 | [[package]] 21 | name = "autocfg" 22 | version = "1.1.0" 23 | source = "registry+https://github.com/rust-lang/crates.io-index" 24 | checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" 25 | 26 | [[package]] 27 | name = "backtrace" 28 | version = "0.3.68" 29 | source = "registry+https://github.com/rust-lang/crates.io-index" 30 | checksum = "4319208da049c43661739c5fade2ba182f09d1dc2299b32298d3a31692b17e12" 31 | dependencies = [ 32 | "addr2line", 33 | "cc", 34 | "cfg-if", 35 | "libc", 36 | "miniz_oxide", 37 | "object", 38 | "rustc-demangle", 39 | ] 40 | 41 | [[package]] 42 | name = "bytes" 43 | version = "1.4.0" 44 | source = "registry+https://github.com/rust-lang/crates.io-index" 45 | checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" 46 | 47 | [[package]] 48 | name = "cc" 49 | version = "1.0.79" 50 | source = "registry+https://github.com/rust-lang/crates.io-index" 51 | checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" 52 | 53 | [[package]] 54 | name = "cfg-if" 55 | version = "1.0.0" 56 | source = "registry+https://github.com/rust-lang/crates.io-index" 57 | checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" 58 | 59 | [[package]] 60 | name = "fnv" 61 | version = "1.0.7" 62 | source = "registry+https://github.com/rust-lang/crates.io-index" 63 | checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" 64 | 65 | [[package]] 66 | name = "futures-channel" 67 | version = "0.3.28" 68 | source = "registry+https://github.com/rust-lang/crates.io-index" 69 | checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" 70 | dependencies = [ 71 | "futures-core", 72 | ] 73 | 74 | [[package]] 75 | name = "futures-core" 76 | version = "0.3.28" 77 | source = "registry+https://github.com/rust-lang/crates.io-index" 78 | checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" 79 | 80 | [[package]] 81 | name = "futures-task" 82 | version = "0.3.28" 83 | source = "registry+https://github.com/rust-lang/crates.io-index" 84 | checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" 85 | 86 | [[package]] 87 | name = "futures-util" 88 | version = "0.3.28" 89 | source = "registry+https://github.com/rust-lang/crates.io-index" 90 | checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" 91 | dependencies = [ 92 | "futures-core", 93 | "futures-task", 94 | "pin-project-lite", 95 | "pin-utils", 96 | ] 97 | 98 | [[package]] 99 | name = "gimli" 100 | version = "0.27.3" 101 | source = "registry+https://github.com/rust-lang/crates.io-index" 102 | checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" 103 | 104 | [[package]] 105 | name = "http" 106 | version = "0.2.9" 107 | source = "registry+https://github.com/rust-lang/crates.io-index" 108 | checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" 109 | dependencies = [ 110 | "bytes", 111 | "fnv", 112 | "itoa", 113 | ] 114 | 115 | [[package]] 116 | name = "http-body" 117 | version = "0.4.5" 118 | source = "registry+https://github.com/rust-lang/crates.io-index" 119 | checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" 120 | dependencies = [ 121 | "bytes", 122 | "http", 123 | "pin-project-lite", 124 | ] 125 | 126 | [[package]] 127 | name = "httparse" 128 | version = "1.8.0" 129 | source = "registry+https://github.com/rust-lang/crates.io-index" 130 | checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" 131 | 132 | [[package]] 133 | name = "httpdate" 134 | version = "1.0.2" 135 | source = "registry+https://github.com/rust-lang/crates.io-index" 136 | checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" 137 | 138 | [[package]] 139 | name = "hyper" 140 | version = "0.14.27" 141 | source = "registry+https://github.com/rust-lang/crates.io-index" 142 | checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" 143 | dependencies = [ 144 | "bytes", 145 | "futures-channel", 146 | "futures-core", 147 | "futures-util", 148 | "http", 149 | "http-body", 150 | "httparse", 151 | "httpdate", 152 | "itoa", 153 | "pin-project-lite", 154 | "socket2", 155 | "tokio", 156 | "tower-service", 157 | "tracing", 158 | "want", 159 | ] 160 | 161 | [[package]] 162 | name = "itoa" 163 | version = "1.0.9" 164 | source = "registry+https://github.com/rust-lang/crates.io-index" 165 | checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" 166 | 167 | [[package]] 168 | name = "libc" 169 | version = "0.2.147" 170 | source = "registry+https://github.com/rust-lang/crates.io-index" 171 | checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" 172 | 173 | [[package]] 174 | name = "memchr" 175 | version = "2.5.0" 176 | source = "registry+https://github.com/rust-lang/crates.io-index" 177 | checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" 178 | 179 | [[package]] 180 | name = "miniz_oxide" 181 | version = "0.7.1" 182 | source = "registry+https://github.com/rust-lang/crates.io-index" 183 | checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" 184 | dependencies = [ 185 | "adler", 186 | ] 187 | 188 | [[package]] 189 | name = "mio" 190 | version = "0.8.8" 191 | source = "registry+https://github.com/rust-lang/crates.io-index" 192 | checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" 193 | dependencies = [ 194 | "libc", 195 | "wasi", 196 | "windows-sys", 197 | ] 198 | 199 | [[package]] 200 | name = "object" 201 | version = "0.31.1" 202 | source = "registry+https://github.com/rust-lang/crates.io-index" 203 | checksum = "8bda667d9f2b5051b8833f59f3bf748b28ef54f850f4fcb389a252aa383866d1" 204 | dependencies = [ 205 | "memchr", 206 | ] 207 | 208 | [[package]] 209 | name = "once_cell" 210 | version = "1.18.0" 211 | source = "registry+https://github.com/rust-lang/crates.io-index" 212 | checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" 213 | 214 | [[package]] 215 | name = "pin-project-lite" 216 | version = "0.2.10" 217 | source = "registry+https://github.com/rust-lang/crates.io-index" 218 | checksum = "4c40d25201921e5ff0c862a505c6557ea88568a4e3ace775ab55e93f2f4f9d57" 219 | 220 | [[package]] 221 | name = "pin-utils" 222 | version = "0.1.0" 223 | source = "registry+https://github.com/rust-lang/crates.io-index" 224 | checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" 225 | 226 | [[package]] 227 | name = "rust-http-server" 228 | version = "0.1.0" 229 | dependencies = [ 230 | "hyper", 231 | "tokio", 232 | ] 233 | 234 | [[package]] 235 | name = "rustc-demangle" 236 | version = "0.1.23" 237 | source = "registry+https://github.com/rust-lang/crates.io-index" 238 | checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" 239 | 240 | [[package]] 241 | name = "socket2" 242 | version = "0.4.9" 243 | source = "registry+https://github.com/rust-lang/crates.io-index" 244 | checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" 245 | dependencies = [ 246 | "libc", 247 | "winapi", 248 | ] 249 | 250 | [[package]] 251 | name = "tokio" 252 | version = "1.29.1" 253 | source = "registry+https://github.com/rust-lang/crates.io-index" 254 | checksum = "532826ff75199d5833b9d2c5fe410f29235e25704ee5f0ef599fb51c21f4a4da" 255 | dependencies = [ 256 | "autocfg", 257 | "backtrace", 258 | "libc", 259 | "mio", 260 | "pin-project-lite", 261 | "socket2", 262 | "windows-sys", 263 | ] 264 | 265 | [[package]] 266 | name = "tower-service" 267 | version = "0.3.2" 268 | source = "registry+https://github.com/rust-lang/crates.io-index" 269 | checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" 270 | 271 | [[package]] 272 | name = "tracing" 273 | version = "0.1.37" 274 | source = "registry+https://github.com/rust-lang/crates.io-index" 275 | checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" 276 | dependencies = [ 277 | "cfg-if", 278 | "pin-project-lite", 279 | "tracing-core", 280 | ] 281 | 282 | [[package]] 283 | name = "tracing-core" 284 | version = "0.1.31" 285 | source = "registry+https://github.com/rust-lang/crates.io-index" 286 | checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" 287 | dependencies = [ 288 | "once_cell", 289 | ] 290 | 291 | [[package]] 292 | name = "try-lock" 293 | version = "0.2.4" 294 | source = "registry+https://github.com/rust-lang/crates.io-index" 295 | checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" 296 | 297 | [[package]] 298 | name = "want" 299 | version = "0.3.1" 300 | source = "registry+https://github.com/rust-lang/crates.io-index" 301 | checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" 302 | dependencies = [ 303 | "try-lock", 304 | ] 305 | 306 | [[package]] 307 | name = "wasi" 308 | version = "0.11.0+wasi-snapshot-preview1" 309 | source = "registry+https://github.com/rust-lang/crates.io-index" 310 | checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" 311 | 312 | [[package]] 313 | name = "winapi" 314 | version = "0.3.9" 315 | source = "registry+https://github.com/rust-lang/crates.io-index" 316 | checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" 317 | dependencies = [ 318 | "winapi-i686-pc-windows-gnu", 319 | "winapi-x86_64-pc-windows-gnu", 320 | ] 321 | 322 | [[package]] 323 | name = "winapi-i686-pc-windows-gnu" 324 | version = "0.4.0" 325 | source = "registry+https://github.com/rust-lang/crates.io-index" 326 | checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 327 | 328 | [[package]] 329 | name = "winapi-x86_64-pc-windows-gnu" 330 | version = "0.4.0" 331 | source = "registry+https://github.com/rust-lang/crates.io-index" 332 | checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 333 | 334 | [[package]] 335 | name = "windows-sys" 336 | version = "0.48.0" 337 | source = "registry+https://github.com/rust-lang/crates.io-index" 338 | checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" 339 | dependencies = [ 340 | "windows-targets", 341 | ] 342 | 343 | [[package]] 344 | name = "windows-targets" 345 | version = "0.48.1" 346 | source = "registry+https://github.com/rust-lang/crates.io-index" 347 | checksum = "05d4b17490f70499f20b9e791dcf6a299785ce8af4d709018206dc5b4953e95f" 348 | dependencies = [ 349 | "windows_aarch64_gnullvm", 350 | "windows_aarch64_msvc", 351 | "windows_i686_gnu", 352 | "windows_i686_msvc", 353 | "windows_x86_64_gnu", 354 | "windows_x86_64_gnullvm", 355 | "windows_x86_64_msvc", 356 | ] 357 | 358 | [[package]] 359 | name = "windows_aarch64_gnullvm" 360 | version = "0.48.0" 361 | source = "registry+https://github.com/rust-lang/crates.io-index" 362 | checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" 363 | 364 | [[package]] 365 | name = "windows_aarch64_msvc" 366 | version = "0.48.0" 367 | source = "registry+https://github.com/rust-lang/crates.io-index" 368 | checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" 369 | 370 | [[package]] 371 | name = "windows_i686_gnu" 372 | version = "0.48.0" 373 | source = "registry+https://github.com/rust-lang/crates.io-index" 374 | checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" 375 | 376 | [[package]] 377 | name = "windows_i686_msvc" 378 | version = "0.48.0" 379 | source = "registry+https://github.com/rust-lang/crates.io-index" 380 | checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" 381 | 382 | [[package]] 383 | name = "windows_x86_64_gnu" 384 | version = "0.48.0" 385 | source = "registry+https://github.com/rust-lang/crates.io-index" 386 | checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" 387 | 388 | [[package]] 389 | name = "windows_x86_64_gnullvm" 390 | version = "0.48.0" 391 | source = "registry+https://github.com/rust-lang/crates.io-index" 392 | checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" 393 | 394 | [[package]] 395 | name = "windows_x86_64_msvc" 396 | version = "0.48.0" 397 | source = "registry+https://github.com/rust-lang/crates.io-index" 398 | checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" 399 | -------------------------------------------------------------------------------- /rust-reqwest/Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 3 4 | 5 | [[package]] 6 | name = "addr2line" 7 | version = "0.20.0" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "f4fa78e18c64fce05e902adecd7a5eed15a5e0a3439f7b0e169f0252214865e3" 10 | dependencies = [ 11 | "gimli", 12 | ] 13 | 14 | [[package]] 15 | name = "adler" 16 | version = "1.0.2" 17 | source = "registry+https://github.com/rust-lang/crates.io-index" 18 | checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" 19 | 20 | [[package]] 21 | name = "autocfg" 22 | version = "1.1.0" 23 | source = "registry+https://github.com/rust-lang/crates.io-index" 24 | checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" 25 | 26 | [[package]] 27 | name = "backtrace" 28 | version = "0.3.68" 29 | source = "registry+https://github.com/rust-lang/crates.io-index" 30 | checksum = "4319208da049c43661739c5fade2ba182f09d1dc2299b32298d3a31692b17e12" 31 | dependencies = [ 32 | "addr2line", 33 | "cc", 34 | "cfg-if", 35 | "libc", 36 | "miniz_oxide", 37 | "object", 38 | "rustc-demangle", 39 | ] 40 | 41 | [[package]] 42 | name = "base64" 43 | version = "0.21.2" 44 | source = "registry+https://github.com/rust-lang/crates.io-index" 45 | checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d" 46 | 47 | [[package]] 48 | name = "bumpalo" 49 | version = "3.13.0" 50 | source = "registry+https://github.com/rust-lang/crates.io-index" 51 | checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" 52 | 53 | [[package]] 54 | name = "bytes" 55 | version = "1.4.0" 56 | source = "registry+https://github.com/rust-lang/crates.io-index" 57 | checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" 58 | 59 | [[package]] 60 | name = "cc" 61 | version = "1.0.79" 62 | source = "registry+https://github.com/rust-lang/crates.io-index" 63 | checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" 64 | 65 | [[package]] 66 | name = "cfg-if" 67 | version = "1.0.0" 68 | source = "registry+https://github.com/rust-lang/crates.io-index" 69 | checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" 70 | 71 | [[package]] 72 | name = "encoding_rs" 73 | version = "0.8.32" 74 | source = "registry+https://github.com/rust-lang/crates.io-index" 75 | checksum = "071a31f4ee85403370b58aca746f01041ede6f0da2730960ad001edc2b71b394" 76 | dependencies = [ 77 | "cfg-if", 78 | ] 79 | 80 | [[package]] 81 | name = "fnv" 82 | version = "1.0.7" 83 | source = "registry+https://github.com/rust-lang/crates.io-index" 84 | checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" 85 | 86 | [[package]] 87 | name = "form_urlencoded" 88 | version = "1.2.0" 89 | source = "registry+https://github.com/rust-lang/crates.io-index" 90 | checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" 91 | dependencies = [ 92 | "percent-encoding", 93 | ] 94 | 95 | [[package]] 96 | name = "futures-channel" 97 | version = "0.3.28" 98 | source = "registry+https://github.com/rust-lang/crates.io-index" 99 | checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" 100 | dependencies = [ 101 | "futures-core", 102 | ] 103 | 104 | [[package]] 105 | name = "futures-core" 106 | version = "0.3.28" 107 | source = "registry+https://github.com/rust-lang/crates.io-index" 108 | checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" 109 | 110 | [[package]] 111 | name = "futures-sink" 112 | version = "0.3.28" 113 | source = "registry+https://github.com/rust-lang/crates.io-index" 114 | checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" 115 | 116 | [[package]] 117 | name = "futures-task" 118 | version = "0.3.28" 119 | source = "registry+https://github.com/rust-lang/crates.io-index" 120 | checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" 121 | 122 | [[package]] 123 | name = "futures-util" 124 | version = "0.3.28" 125 | source = "registry+https://github.com/rust-lang/crates.io-index" 126 | checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" 127 | dependencies = [ 128 | "futures-core", 129 | "futures-task", 130 | "pin-project-lite", 131 | "pin-utils", 132 | ] 133 | 134 | [[package]] 135 | name = "gimli" 136 | version = "0.27.3" 137 | source = "registry+https://github.com/rust-lang/crates.io-index" 138 | checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" 139 | 140 | [[package]] 141 | name = "h2" 142 | version = "0.3.20" 143 | source = "registry+https://github.com/rust-lang/crates.io-index" 144 | checksum = "97ec8491ebaf99c8eaa73058b045fe58073cd6be7f596ac993ced0b0a0c01049" 145 | dependencies = [ 146 | "bytes", 147 | "fnv", 148 | "futures-core", 149 | "futures-sink", 150 | "futures-util", 151 | "http", 152 | "indexmap", 153 | "slab", 154 | "tokio", 155 | "tokio-util", 156 | "tracing", 157 | ] 158 | 159 | [[package]] 160 | name = "hashbrown" 161 | version = "0.12.3" 162 | source = "registry+https://github.com/rust-lang/crates.io-index" 163 | checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" 164 | 165 | [[package]] 166 | name = "http" 167 | version = "0.2.9" 168 | source = "registry+https://github.com/rust-lang/crates.io-index" 169 | checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" 170 | dependencies = [ 171 | "bytes", 172 | "fnv", 173 | "itoa", 174 | ] 175 | 176 | [[package]] 177 | name = "http-body" 178 | version = "0.4.5" 179 | source = "registry+https://github.com/rust-lang/crates.io-index" 180 | checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" 181 | dependencies = [ 182 | "bytes", 183 | "http", 184 | "pin-project-lite", 185 | ] 186 | 187 | [[package]] 188 | name = "httparse" 189 | version = "1.8.0" 190 | source = "registry+https://github.com/rust-lang/crates.io-index" 191 | checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" 192 | 193 | [[package]] 194 | name = "httpdate" 195 | version = "1.0.2" 196 | source = "registry+https://github.com/rust-lang/crates.io-index" 197 | checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" 198 | 199 | [[package]] 200 | name = "hyper" 201 | version = "0.14.27" 202 | source = "registry+https://github.com/rust-lang/crates.io-index" 203 | checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" 204 | dependencies = [ 205 | "bytes", 206 | "futures-channel", 207 | "futures-core", 208 | "futures-util", 209 | "h2", 210 | "http", 211 | "http-body", 212 | "httparse", 213 | "httpdate", 214 | "itoa", 215 | "pin-project-lite", 216 | "socket2", 217 | "tokio", 218 | "tower-service", 219 | "tracing", 220 | "want", 221 | ] 222 | 223 | [[package]] 224 | name = "idna" 225 | version = "0.4.0" 226 | source = "registry+https://github.com/rust-lang/crates.io-index" 227 | checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" 228 | dependencies = [ 229 | "unicode-bidi", 230 | "unicode-normalization", 231 | ] 232 | 233 | [[package]] 234 | name = "indexmap" 235 | version = "1.9.3" 236 | source = "registry+https://github.com/rust-lang/crates.io-index" 237 | checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" 238 | dependencies = [ 239 | "autocfg", 240 | "hashbrown", 241 | ] 242 | 243 | [[package]] 244 | name = "ipnet" 245 | version = "2.8.0" 246 | source = "registry+https://github.com/rust-lang/crates.io-index" 247 | checksum = "28b29a3cd74f0f4598934efe3aeba42bae0eb4680554128851ebbecb02af14e6" 248 | 249 | [[package]] 250 | name = "itoa" 251 | version = "1.0.8" 252 | source = "registry+https://github.com/rust-lang/crates.io-index" 253 | checksum = "62b02a5381cc465bd3041d84623d0fa3b66738b52b8e2fc3bab8ad63ab032f4a" 254 | 255 | [[package]] 256 | name = "js-sys" 257 | version = "0.3.64" 258 | source = "registry+https://github.com/rust-lang/crates.io-index" 259 | checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" 260 | dependencies = [ 261 | "wasm-bindgen", 262 | ] 263 | 264 | [[package]] 265 | name = "libc" 266 | version = "0.2.147" 267 | source = "registry+https://github.com/rust-lang/crates.io-index" 268 | checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" 269 | 270 | [[package]] 271 | name = "log" 272 | version = "0.4.19" 273 | source = "registry+https://github.com/rust-lang/crates.io-index" 274 | checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4" 275 | 276 | [[package]] 277 | name = "memchr" 278 | version = "2.5.0" 279 | source = "registry+https://github.com/rust-lang/crates.io-index" 280 | checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" 281 | 282 | [[package]] 283 | name = "mime" 284 | version = "0.3.17" 285 | source = "registry+https://github.com/rust-lang/crates.io-index" 286 | checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" 287 | 288 | [[package]] 289 | name = "miniz_oxide" 290 | version = "0.7.1" 291 | source = "registry+https://github.com/rust-lang/crates.io-index" 292 | checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" 293 | dependencies = [ 294 | "adler", 295 | ] 296 | 297 | [[package]] 298 | name = "mio" 299 | version = "0.8.8" 300 | source = "registry+https://github.com/rust-lang/crates.io-index" 301 | checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" 302 | dependencies = [ 303 | "libc", 304 | "wasi", 305 | "windows-sys", 306 | ] 307 | 308 | [[package]] 309 | name = "object" 310 | version = "0.31.1" 311 | source = "registry+https://github.com/rust-lang/crates.io-index" 312 | checksum = "8bda667d9f2b5051b8833f59f3bf748b28ef54f850f4fcb389a252aa383866d1" 313 | dependencies = [ 314 | "memchr", 315 | ] 316 | 317 | [[package]] 318 | name = "once_cell" 319 | version = "1.18.0" 320 | source = "registry+https://github.com/rust-lang/crates.io-index" 321 | checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" 322 | 323 | [[package]] 324 | name = "percent-encoding" 325 | version = "2.3.0" 326 | source = "registry+https://github.com/rust-lang/crates.io-index" 327 | checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" 328 | 329 | [[package]] 330 | name = "pin-project-lite" 331 | version = "0.2.10" 332 | source = "registry+https://github.com/rust-lang/crates.io-index" 333 | checksum = "4c40d25201921e5ff0c862a505c6557ea88568a4e3ace775ab55e93f2f4f9d57" 334 | 335 | [[package]] 336 | name = "pin-utils" 337 | version = "0.1.0" 338 | source = "registry+https://github.com/rust-lang/crates.io-index" 339 | checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" 340 | 341 | [[package]] 342 | name = "proc-macro2" 343 | version = "1.0.63" 344 | source = "registry+https://github.com/rust-lang/crates.io-index" 345 | checksum = "7b368fba921b0dce7e60f5e04ec15e565b3303972b42bcfde1d0713b881959eb" 346 | dependencies = [ 347 | "unicode-ident", 348 | ] 349 | 350 | [[package]] 351 | name = "quote" 352 | version = "1.0.29" 353 | source = "registry+https://github.com/rust-lang/crates.io-index" 354 | checksum = "573015e8ab27661678357f27dc26460738fd2b6c86e46f386fde94cb5d913105" 355 | dependencies = [ 356 | "proc-macro2", 357 | ] 358 | 359 | [[package]] 360 | name = "reqwest" 361 | version = "0.11.18" 362 | source = "registry+https://github.com/rust-lang/crates.io-index" 363 | checksum = "cde824a14b7c14f85caff81225f411faacc04a2013f41670f41443742b1c1c55" 364 | dependencies = [ 365 | "base64", 366 | "bytes", 367 | "encoding_rs", 368 | "futures-core", 369 | "futures-util", 370 | "h2", 371 | "http", 372 | "http-body", 373 | "hyper", 374 | "ipnet", 375 | "js-sys", 376 | "log", 377 | "mime", 378 | "once_cell", 379 | "percent-encoding", 380 | "pin-project-lite", 381 | "serde", 382 | "serde_json", 383 | "serde_urlencoded", 384 | "tokio", 385 | "tower-service", 386 | "url", 387 | "wasm-bindgen", 388 | "wasm-bindgen-futures", 389 | "web-sys", 390 | "winreg", 391 | ] 392 | 393 | [[package]] 394 | name = "rust-reqwest" 395 | version = "0.1.0" 396 | dependencies = [ 397 | "reqwest", 398 | "tokio", 399 | ] 400 | 401 | [[package]] 402 | name = "rustc-demangle" 403 | version = "0.1.23" 404 | source = "registry+https://github.com/rust-lang/crates.io-index" 405 | checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" 406 | 407 | [[package]] 408 | name = "ryu" 409 | version = "1.0.14" 410 | source = "registry+https://github.com/rust-lang/crates.io-index" 411 | checksum = "fe232bdf6be8c8de797b22184ee71118d63780ea42ac85b61d1baa6d3b782ae9" 412 | 413 | [[package]] 414 | name = "serde" 415 | version = "1.0.166" 416 | source = "registry+https://github.com/rust-lang/crates.io-index" 417 | checksum = "d01b7404f9d441d3ad40e6a636a7782c377d2abdbe4fa2440e2edcc2f4f10db8" 418 | 419 | [[package]] 420 | name = "serde_json" 421 | version = "1.0.99" 422 | source = "registry+https://github.com/rust-lang/crates.io-index" 423 | checksum = "46266871c240a00b8f503b877622fe33430b3c7d963bdc0f2adc511e54a1eae3" 424 | dependencies = [ 425 | "itoa", 426 | "ryu", 427 | "serde", 428 | ] 429 | 430 | [[package]] 431 | name = "serde_urlencoded" 432 | version = "0.7.1" 433 | source = "registry+https://github.com/rust-lang/crates.io-index" 434 | checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" 435 | dependencies = [ 436 | "form_urlencoded", 437 | "itoa", 438 | "ryu", 439 | "serde", 440 | ] 441 | 442 | [[package]] 443 | name = "slab" 444 | version = "0.4.8" 445 | source = "registry+https://github.com/rust-lang/crates.io-index" 446 | checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" 447 | dependencies = [ 448 | "autocfg", 449 | ] 450 | 451 | [[package]] 452 | name = "socket2" 453 | version = "0.4.9" 454 | source = "registry+https://github.com/rust-lang/crates.io-index" 455 | checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" 456 | dependencies = [ 457 | "libc", 458 | "winapi", 459 | ] 460 | 461 | [[package]] 462 | name = "syn" 463 | version = "2.0.23" 464 | source = "registry+https://github.com/rust-lang/crates.io-index" 465 | checksum = "59fb7d6d8281a51045d62b8eb3a7d1ce347b76f312af50cd3dc0af39c87c1737" 466 | dependencies = [ 467 | "proc-macro2", 468 | "quote", 469 | "unicode-ident", 470 | ] 471 | 472 | [[package]] 473 | name = "tinyvec" 474 | version = "1.6.0" 475 | source = "registry+https://github.com/rust-lang/crates.io-index" 476 | checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" 477 | dependencies = [ 478 | "tinyvec_macros", 479 | ] 480 | 481 | [[package]] 482 | name = "tinyvec_macros" 483 | version = "0.1.1" 484 | source = "registry+https://github.com/rust-lang/crates.io-index" 485 | checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" 486 | 487 | [[package]] 488 | name = "tokio" 489 | version = "1.29.1" 490 | source = "registry+https://github.com/rust-lang/crates.io-index" 491 | checksum = "532826ff75199d5833b9d2c5fe410f29235e25704ee5f0ef599fb51c21f4a4da" 492 | dependencies = [ 493 | "autocfg", 494 | "backtrace", 495 | "bytes", 496 | "libc", 497 | "mio", 498 | "pin-project-lite", 499 | "socket2", 500 | "windows-sys", 501 | ] 502 | 503 | [[package]] 504 | name = "tokio-util" 505 | version = "0.7.8" 506 | source = "registry+https://github.com/rust-lang/crates.io-index" 507 | checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" 508 | dependencies = [ 509 | "bytes", 510 | "futures-core", 511 | "futures-sink", 512 | "pin-project-lite", 513 | "tokio", 514 | "tracing", 515 | ] 516 | 517 | [[package]] 518 | name = "tower-service" 519 | version = "0.3.2" 520 | source = "registry+https://github.com/rust-lang/crates.io-index" 521 | checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" 522 | 523 | [[package]] 524 | name = "tracing" 525 | version = "0.1.37" 526 | source = "registry+https://github.com/rust-lang/crates.io-index" 527 | checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" 528 | dependencies = [ 529 | "cfg-if", 530 | "pin-project-lite", 531 | "tracing-core", 532 | ] 533 | 534 | [[package]] 535 | name = "tracing-core" 536 | version = "0.1.31" 537 | source = "registry+https://github.com/rust-lang/crates.io-index" 538 | checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" 539 | dependencies = [ 540 | "once_cell", 541 | ] 542 | 543 | [[package]] 544 | name = "try-lock" 545 | version = "0.2.4" 546 | source = "registry+https://github.com/rust-lang/crates.io-index" 547 | checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" 548 | 549 | [[package]] 550 | name = "unicode-bidi" 551 | version = "0.3.13" 552 | source = "registry+https://github.com/rust-lang/crates.io-index" 553 | checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" 554 | 555 | [[package]] 556 | name = "unicode-ident" 557 | version = "1.0.10" 558 | source = "registry+https://github.com/rust-lang/crates.io-index" 559 | checksum = "22049a19f4a68748a168c0fc439f9516686aa045927ff767eca0a85101fb6e73" 560 | 561 | [[package]] 562 | name = "unicode-normalization" 563 | version = "0.1.22" 564 | source = "registry+https://github.com/rust-lang/crates.io-index" 565 | checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" 566 | dependencies = [ 567 | "tinyvec", 568 | ] 569 | 570 | [[package]] 571 | name = "url" 572 | version = "2.4.0" 573 | source = "registry+https://github.com/rust-lang/crates.io-index" 574 | checksum = "50bff7831e19200a85b17131d085c25d7811bc4e186efdaf54bbd132994a88cb" 575 | dependencies = [ 576 | "form_urlencoded", 577 | "idna", 578 | "percent-encoding", 579 | ] 580 | 581 | [[package]] 582 | name = "want" 583 | version = "0.3.1" 584 | source = "registry+https://github.com/rust-lang/crates.io-index" 585 | checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" 586 | dependencies = [ 587 | "try-lock", 588 | ] 589 | 590 | [[package]] 591 | name = "wasi" 592 | version = "0.11.0+wasi-snapshot-preview1" 593 | source = "registry+https://github.com/rust-lang/crates.io-index" 594 | checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" 595 | 596 | [[package]] 597 | name = "wasm-bindgen" 598 | version = "0.2.87" 599 | source = "registry+https://github.com/rust-lang/crates.io-index" 600 | checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" 601 | dependencies = [ 602 | "cfg-if", 603 | "wasm-bindgen-macro", 604 | ] 605 | 606 | [[package]] 607 | name = "wasm-bindgen-backend" 608 | version = "0.2.87" 609 | source = "registry+https://github.com/rust-lang/crates.io-index" 610 | checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" 611 | dependencies = [ 612 | "bumpalo", 613 | "log", 614 | "once_cell", 615 | "proc-macro2", 616 | "quote", 617 | "syn", 618 | "wasm-bindgen-shared", 619 | ] 620 | 621 | [[package]] 622 | name = "wasm-bindgen-futures" 623 | version = "0.4.37" 624 | source = "registry+https://github.com/rust-lang/crates.io-index" 625 | checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03" 626 | dependencies = [ 627 | "cfg-if", 628 | "js-sys", 629 | "wasm-bindgen", 630 | "web-sys", 631 | ] 632 | 633 | [[package]] 634 | name = "wasm-bindgen-macro" 635 | version = "0.2.87" 636 | source = "registry+https://github.com/rust-lang/crates.io-index" 637 | checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" 638 | dependencies = [ 639 | "quote", 640 | "wasm-bindgen-macro-support", 641 | ] 642 | 643 | [[package]] 644 | name = "wasm-bindgen-macro-support" 645 | version = "0.2.87" 646 | source = "registry+https://github.com/rust-lang/crates.io-index" 647 | checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" 648 | dependencies = [ 649 | "proc-macro2", 650 | "quote", 651 | "syn", 652 | "wasm-bindgen-backend", 653 | "wasm-bindgen-shared", 654 | ] 655 | 656 | [[package]] 657 | name = "wasm-bindgen-shared" 658 | version = "0.2.87" 659 | source = "registry+https://github.com/rust-lang/crates.io-index" 660 | checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" 661 | 662 | [[package]] 663 | name = "web-sys" 664 | version = "0.3.64" 665 | source = "registry+https://github.com/rust-lang/crates.io-index" 666 | checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" 667 | dependencies = [ 668 | "js-sys", 669 | "wasm-bindgen", 670 | ] 671 | 672 | [[package]] 673 | name = "winapi" 674 | version = "0.3.9" 675 | source = "registry+https://github.com/rust-lang/crates.io-index" 676 | checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" 677 | dependencies = [ 678 | "winapi-i686-pc-windows-gnu", 679 | "winapi-x86_64-pc-windows-gnu", 680 | ] 681 | 682 | [[package]] 683 | name = "winapi-i686-pc-windows-gnu" 684 | version = "0.4.0" 685 | source = "registry+https://github.com/rust-lang/crates.io-index" 686 | checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 687 | 688 | [[package]] 689 | name = "winapi-x86_64-pc-windows-gnu" 690 | version = "0.4.0" 691 | source = "registry+https://github.com/rust-lang/crates.io-index" 692 | checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 693 | 694 | [[package]] 695 | name = "windows-sys" 696 | version = "0.48.0" 697 | source = "registry+https://github.com/rust-lang/crates.io-index" 698 | checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" 699 | dependencies = [ 700 | "windows-targets", 701 | ] 702 | 703 | [[package]] 704 | name = "windows-targets" 705 | version = "0.48.1" 706 | source = "registry+https://github.com/rust-lang/crates.io-index" 707 | checksum = "05d4b17490f70499f20b9e791dcf6a299785ce8af4d709018206dc5b4953e95f" 708 | dependencies = [ 709 | "windows_aarch64_gnullvm", 710 | "windows_aarch64_msvc", 711 | "windows_i686_gnu", 712 | "windows_i686_msvc", 713 | "windows_x86_64_gnu", 714 | "windows_x86_64_gnullvm", 715 | "windows_x86_64_msvc", 716 | ] 717 | 718 | [[package]] 719 | name = "windows_aarch64_gnullvm" 720 | version = "0.48.0" 721 | source = "registry+https://github.com/rust-lang/crates.io-index" 722 | checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" 723 | 724 | [[package]] 725 | name = "windows_aarch64_msvc" 726 | version = "0.48.0" 727 | source = "registry+https://github.com/rust-lang/crates.io-index" 728 | checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" 729 | 730 | [[package]] 731 | name = "windows_i686_gnu" 732 | version = "0.48.0" 733 | source = "registry+https://github.com/rust-lang/crates.io-index" 734 | checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" 735 | 736 | [[package]] 737 | name = "windows_i686_msvc" 738 | version = "0.48.0" 739 | source = "registry+https://github.com/rust-lang/crates.io-index" 740 | checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" 741 | 742 | [[package]] 743 | name = "windows_x86_64_gnu" 744 | version = "0.48.0" 745 | source = "registry+https://github.com/rust-lang/crates.io-index" 746 | checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" 747 | 748 | [[package]] 749 | name = "windows_x86_64_gnullvm" 750 | version = "0.48.0" 751 | source = "registry+https://github.com/rust-lang/crates.io-index" 752 | checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" 753 | 754 | [[package]] 755 | name = "windows_x86_64_msvc" 756 | version = "0.48.0" 757 | source = "registry+https://github.com/rust-lang/crates.io-index" 758 | checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" 759 | 760 | [[package]] 761 | name = "winreg" 762 | version = "0.10.1" 763 | source = "registry+https://github.com/rust-lang/crates.io-index" 764 | checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" 765 | dependencies = [ 766 | "winapi", 767 | ] 768 | --------------------------------------------------------------------------------