{"id":23739825,"url":"https://github.com/p1atdev/zig-simple-http-server","last_synced_at":"2025-06-17T23:35:53.691Z","repository":{"id":56727124,"uuid":"524244042","full_name":"p1atdev/zig-simple-http-server","owner":"p1atdev","description":null,"archived":false,"fork":false,"pushed_at":"2022-08-12T22:58:21.000Z","size":238,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-31T20:56:30.701Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Zig","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/p1atdev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-08-12T22:53:42.000Z","updated_at":"2022-08-12T22:54:07.000Z","dependencies_parsed_at":"2022-08-16T00:31:09.570Z","dependency_job_id":null,"html_url":"https://github.com/p1atdev/zig-simple-http-server","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/p1atdev/zig-simple-http-server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p1atdev%2Fzig-simple-http-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p1atdev%2Fzig-simple-http-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p1atdev%2Fzig-simple-http-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p1atdev%2Fzig-simple-http-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/p1atdev","download_url":"https://codeload.github.com/p1atdev/zig-simple-http-server/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p1atdev%2Fzig-simple-http-server/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260458282,"owners_count":23012476,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-31T09:39:24.512Z","updated_at":"2025-06-17T23:35:48.558Z","avatar_url":"https://github.com/p1atdev.png","language":"Zig","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Zig simple http server example\n\n## Code\n\n```zig\nconst print = std.debug.print;\nconst std = @import(\"std\");\nconst net = std.net;\n\npub fn main() anyerror!void {\n    var server = net.StreamServer.init(.{});\n    defer server.deinit();\n\n    try server.listen(net.Address.parseIp(\"0.0.0.0\", 3000) catch unreachable);\n\n    while (true) {\n        const conn: net.StreamServer.Connection = try server.accept();\n        var buff: [1024]u8 = undefined;\n\n        const r = conn.stream.reader();\n        _ = try r.read(buff[0..]);\n        print(\"Request: {s}\\n\\n\", .{buff});\n\n        var w = conn.stream.writer();\n        const msg = \"HTTP/1.1 200 OK\\r\\n\\r\\nHello, World\\n\";\n        try w.writeAll(msg);\n        print(\"Response: {s}\\n\\n\", .{msg});\n\n        conn.stream.close();\n    }\n}\n```\n\n## Reference\n\nhttps://github.com/ziglang/zig/blob/master/lib/std/x/net/tcp.zig\n\nhttps://doc.rust-lang.org/book/ch20-01-single-threaded.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fp1atdev%2Fzig-simple-http-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fp1atdev%2Fzig-simple-http-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fp1atdev%2Fzig-simple-http-server/lists"}