Skip to main content
FastEdge CDN applications run inside Gcore’s CDN pipeline and can intercept HTTP traffic at four stages: on request headers, on request body, on response headers, and on response body. They are built on the Proxy-Wasm specification — an open standard for WebAssembly-based proxy extensions used across CDN and service mesh environments. In Rust, Proxy-Wasm applications use the proxy-wasm crate. Instead of a single request handler, a CDN application implements callbacks such as on_http_request_headers and on_http_response_headers, which the CDN runtime invokes at different stages of request processing. Rust and Cargo are required. On Windows, also install Visual Studio Build Tools with the Desktop development with C++ workload.

Add the WebAssembly target

CDN apps compile to wasm32-wasip1. Add the target once — it applies to all future builds:
If the Legacy Rust SDK is already set up, this target is already present.

Configure a project

FastEdge applications compile to WebAssembly libraries. Two changes from the Cargo defaults are needed: the output type must be cdylib, and proxy-wasm must be listed as a dependency.
  1. Create the library crate:
  2. Replace the contents of Cargo.toml:
    proxy-wasm = "0.2" provides the filter traits and the proxy_wasm::main! entry point. log is used for structured logging inside the CDN pipeline.

Verify the toolchain

A minimal filter that adds a custom request header is enough to confirm the toolchain produces a valid CDN binary. Replace src/lib.rs:
Build it:
The first build downloads dependencies and takes one to two minutes. When it completes without errors, the toolchain is ready — the compiled binary is at ./target/wasm32-wasip1/release/my_cdn_app.wasm. That file can be uploaded to FastEdge as a CDN application.