diff --git a/proxy.ini b/proxy.ini index cf40a9b..455a675 100644 --- a/proxy.ini +++ b/proxy.ini @@ -8,6 +8,7 @@ # :
Host: iam / = zig-out/lib/libflexilib-sample-lib.so /c = zig-out/lib/libflexilib-in-c.so +/universal = zig-out/lib/libuniversal-lambda-example.so / = zig-out/lib/libflexilib-sample-lib.so # JS-based Cloudflare worker: 0.051s +/- 0.002s (50ms) diff --git a/src/interface.zig b/src/interface.zig index 43160e9..25f5503 100644 --- a/src/interface.zig +++ b/src/interface.zig @@ -17,6 +17,9 @@ pub const Response = extern struct { }; pub const Request = extern struct { + target: [*]const u8, + target_len: usize, + method: [*:0]u8, method_len: usize, diff --git a/src/main-lib.zig b/src/main-lib.zig index 7ae8a82..9db4506 100644 --- a/src/main-lib.zig +++ b/src/main-lib.zig @@ -92,6 +92,8 @@ test "handle_request" { .value_len = 3, }}); var req = interface.Request{ + .target = @ptrCast(@constCast("/".ptr)), + .target_len = 1, .method = @ptrCast(@constCast("GET".ptr)), .method_len = 3, .content = @ptrCast(@constCast("GET".ptr)), diff --git a/src/main.zig b/src/main.zig index a566b18..4445e64 100644 --- a/src/main.zig +++ b/src/main.zig @@ -82,6 +82,9 @@ fn serve(allocator: *std.mem.Allocator, response: *std.http.Server.Response) !*F } log.debug("{d} bytes read from request", .{request_content.len}); var request = interface.Request{ + .target = response.request.target.ptr, + .target_len = response.request.target.len, + .method = @constCast(method_tag[0..].ptr), .method_len = method_tag.len,