Skip to content

request url example#73

Open
ruslanti wants to merge 5 commits into
mainfrom
feat/request_url_example
Open

request url example#73
ruslanti wants to merge 5 commits into
mainfrom
feat/request_url_example

Conversation

@ruslanti
Copy link
Copy Markdown
Collaborator

No description provided.

ruslanti added 4 commits May 22, 2026 15:56
…rgets

- Improved example builds by specifying `--manifest-path` for clarity.
- Scoped `ci.yaml` commands to `fastedge` and `fastedge-derive` packages.
- Introduced `http_wasi_print` example which logs request details and responds with method, URL, and headers.
- Added `Cargo.toml` and `README.md` for the new example.
@ruslanti ruslanti self-assigned this May 22, 2026
@ruslanti ruslanti added the enhancement New feature or request label May 22, 2026
Copilot AI review requested due to automatic review settings May 22, 2026 13:20
@ruslanti ruslanti requested review from godronus and qrdl May 22, 2026 13:22
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR modernizes the repo workspace to include all example crates (while keeping the core SDK as the default build), updates manifests to Rust 2024 edition with unique crate names, and adds new examples demonstrating request inspection (WASI) and request URL/property rewriting (CDN proxy-wasm).

Changes:

  • Add new examples: examples/http/wasi/print (WASI) and examples/cdn/request_url (CDN proxy-wasm).
  • Convert examples into workspace members and rename example crates to avoid package-name collisions; bump editions to 2024.
  • Adjust CI workflows to build/doc/clippy only SDK crates, and update the examples build workflow to build by --manifest-path.

Reviewed changes

Copilot reviewed 55 out of 57 changed files in this pull request and generated 22 comments.

Show a summary per file
File Description
src/proxywasm/mod.rs Marks the FFI extern block as unsafe extern "C" (Rust 2024 compatibility).
examples/README.md Adds the new WASI print example to the index table.
examples/http/wasi/variables_and_secrets/Cargo.toml Renames package + updates edition for workspace inclusion.
examples/http/wasi/simple_fetch/Cargo.toml Renames package + updates edition for workspace inclusion.
examples/http/wasi/secret_rollover/Cargo.toml Renames package + updates edition for workspace inclusion.
examples/http/wasi/print/src/lib.rs New WASI example that outputs method/URL/headers into the response body.
examples/http/wasi/print/README.md New README for the WASI print example.
examples/http/wasi/print/Cargo.toml New manifest for the WASI print example.
examples/http/wasi/outbound_fetch/src/lib.rs Switches to env-configured origin and returns upstream response directly.
examples/http/wasi/outbound_fetch/Cargo.toml Renames package + updates edition for workspace inclusion.
examples/http/wasi/large_env_variable/Cargo.toml Renames package + updates edition for workspace inclusion.
examples/http/wasi/key_value/Cargo.toml Renames package + updates edition for workspace inclusion.
examples/http/wasi/hello_world/Cargo.toml Renames package + updates edition for workspace inclusion.
examples/http/wasi/headers/Cargo.toml Renames package + updates edition for workspace inclusion.
examples/http/wasi/geo_redirect/Cargo.toml Renames package + updates edition for workspace inclusion.
examples/http/wasi/cache/Cargo.toml Renames package + updates edition for workspace inclusion.
examples/http/wasi/cache/Cargo.lock Updates pinned fastedge versions used by this example.
examples/http/basic/watermark/Cargo.toml Renames package + updates edition for workspace inclusion.
examples/http/basic/smart_switch/Cargo.toml Renames package + updates edition for workspace inclusion.
examples/http/basic/secret/Cargo.toml Renames package + updates edition for workspace inclusion.
examples/http/basic/s3upload/Cargo.toml Renames package + updates edition for workspace inclusion.
examples/http/basic/print/Cargo.toml Renames package + updates edition for workspace inclusion.
examples/http/basic/outbound_fetch/Cargo.toml Renames package + updates edition for workspace inclusion.
examples/http/basic/markdown_render/Cargo.toml Renames package + updates edition for workspace inclusion.
examples/http/basic/hello_world/Cargo.toml Renames package + updates edition for workspace inclusion.
examples/http/basic/cache/Cargo.toml Renames package + updates edition for workspace inclusion.
examples/http/basic/backend/Cargo.toml Renames package + updates edition for workspace inclusion.
examples/http/basic/api_wrapper/Cargo.toml Renames package + updates edition for workspace inclusion.
examples/cdn/variables_and_secrets/Cargo.toml Renames package for workspace inclusion.
examples/cdn/request_url/src/lib.rs New CDN example that rewrites request properties based on special headers.
examples/cdn/request_url/README.md New README documenting request property rewriting behavior.
examples/cdn/request_url/Cargo.toml New manifest for the request_url CDN example.
examples/cdn/properties/Cargo.toml Renames package for workspace inclusion.
examples/cdn/md2html/Cargo.toml Renames package for workspace inclusion.
examples/cdn/log_time/Cargo.toml Renames package for workspace inclusion.
examples/cdn/large_env_variable/Cargo.toml Renames package for workspace inclusion.
examples/cdn/key_value/Cargo.toml Renames package for workspace inclusion.
examples/cdn/jwt/Cargo.toml Renames package for workspace inclusion.
examples/cdn/http_call/Cargo.toml Renames package for workspace inclusion.
examples/cdn/hello_world/Cargo.toml Renames package for workspace inclusion.
examples/cdn/headers/Cargo.toml Renames package for workspace inclusion.
examples/cdn/geoblock/Cargo.toml Renames package for workspace inclusion.
examples/cdn/geo_redirect/Cargo.toml Renames package for workspace inclusion.
examples/cdn/custom/Cargo.toml Renames package for workspace inclusion.
examples/cdn/custom_error_pages/Cargo.toml Renames package for workspace inclusion.
examples/cdn/cors/Cargo.toml Renames package for workspace inclusion.
examples/cdn/convert_image/Cargo.toml Renames package for workspace inclusion.
examples/cdn/cache_control/Cargo.toml Renames package for workspace inclusion.
examples/cdn/body/Cargo.toml Renames package for workspace inclusion.
examples/cdn/api_key/Cargo.toml Renames package for workspace inclusion.
examples/cdn/ab_testing/Cargo.toml Renames package for workspace inclusion.
derive/src/lib.rs Updates no_mangle usage for Rust 2024 (#[unsafe(no_mangle)]).
derive/Cargo.toml Updates derive crate edition to 2024.
Cargo.toml Expands workspace members to include all examples; sets workspace edition/version; narrows default-members.
Cargo.lock Updates lockfile to include workspace-wide deps (including examples).
.github/workflows/ci.yaml Builds/docs/clippy only SDK packages (not all workspace members).
.github/workflows/build-examples.yaml Builds examples via --manifest-path (no per-dir subshell).

Comment thread Cargo.toml
Comment on lines +5 to +50
# CDN examples
"examples/cdn/ab_testing",
"examples/cdn/api_key",
"examples/cdn/body",
"examples/cdn/cache_control",
"examples/cdn/convert_image",
"examples/cdn/cors",
"examples/cdn/custom",
"examples/cdn/custom_error_pages",
"examples/cdn/geo_redirect",
"examples/cdn/geoblock",
"examples/cdn/headers",
"examples/cdn/hello_world",
"examples/cdn/http_call",
"examples/cdn/jwt",
"examples/cdn/key_value",
"examples/cdn/large_env_variable",
"examples/cdn/log_time",
"examples/cdn/md2html",
"examples/cdn/properties",
"examples/cdn/request_url",
"examples/cdn/variables_and_secrets",
# HTTP basic (sync) examples
"examples/http/basic/api_wrapper",
"examples/http/basic/backend",
"examples/http/basic/cache",
"examples/http/basic/hello_world",
"examples/http/basic/markdown_render",
"examples/http/basic/outbound_fetch",
"examples/http/basic/print",
"examples/http/basic/s3upload",
"examples/http/basic/secret",
"examples/http/basic/smart_switch",
"examples/http/basic/watermark",
# HTTP WASI (async) examples
"examples/http/wasi/cache",
"examples/http/wasi/geo_redirect",
"examples/http/wasi/headers",
"examples/http/wasi/hello_world",
"examples/http/wasi/key_value",
"examples/http/wasi/large_env_variable",
"examples/http/wasi/outbound_fetch",
"examples/http/wasi/print",
"examples/http/wasi/secret_rollover",
"examples/http/wasi/simple_fetch",
"examples/http/wasi/variables_and_secrets",
Comment thread examples/README.md
Comment on lines 25 to 27
| [hello_world](./http/wasi/hello_world/) | Simplest async request handler — returns a greeting with the request URL |
| [print](./http/wasi/print/) | Print request method, URL, and headers to the response body |
| [headers](./http/wasi/headers/) | Echo request headers and add a custom header from an environment variable |
[dependencies]
log = "0.4"
proxy-wasm = "0.2"
querystring = "1.1"
Comment on lines 2 to 6
[package]
name = "api_wrapper"
name = "http_api_wrapper"
version = "0.1.0"
edition = "2021"
edition = "2024"

Comment on lines 2 to 6
[package]
name = "backend"
name = "http_backend"
version = "0.1.0"
edition = "2021"
edition = "2024"

Comment on lines 2 to 6
[package]
name = "api_key"
name = "cdn_api_key"
version = "0.1.0"
edition = "2024"

Comment on lines 2 to 6
[package]
name = "jwt"
name = "cdn_jwt"
version = "0.1.0"
edition = "2024"

Comment on lines 2 to 6
[package]
name = "key_value"
name = "cdn_key_value"
version = "0.1.0"
edition = "2024"

Comment on lines 2 to 6
[package]
name = "large_env_variable"
name = "cdn_large_env_variable"
version = "0.1.0"
edition = "2024"

Comment on lines 2 to 6
[package]
name = "variables_and_secrets"
name = "cdn_variables_and_secrets"
version = "0.1.0"
edition = "2024"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants