{"id":19888306,"url":"https://github.com/wasmedge/wasmedge_hyper_demo","last_synced_at":"2025-07-23T09:08:03.425Z","repository":{"id":63653565,"uuid":"525020479","full_name":"WasmEdge/wasmedge_hyper_demo","owner":"WasmEdge","description":"Lightweight HTTP servers based on hyper / warp frameworks in the WasmEdge Runtime.","archived":false,"fork":false,"pushed_at":"2024-07-17T03:13:46.000Z","size":23048,"stargazers_count":86,"open_issues_count":6,"forks_count":14,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-04-05T10:11:15.263Z","etag":null,"topics":["http","http-client","http-server","httpclient","httpd","rust","wasm","webassembly"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/WasmEdge.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-08-15T14:33:36.000Z","updated_at":"2025-03-16T16:08:24.000Z","dependencies_parsed_at":"2023-02-19T01:01:51.862Z","dependency_job_id":"182d58b6-77d4-4432-a564-d4c35b75807a","html_url":"https://github.com/WasmEdge/wasmedge_hyper_demo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/WasmEdge/wasmedge_hyper_demo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WasmEdge%2Fwasmedge_hyper_demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WasmEdge%2Fwasmedge_hyper_demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WasmEdge%2Fwasmedge_hyper_demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WasmEdge%2Fwasmedge_hyper_demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WasmEdge","download_url":"https://codeload.github.com/WasmEdge/wasmedge_hyper_demo/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WasmEdge%2Fwasmedge_hyper_demo/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266649176,"owners_count":23962181,"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","status":"online","status_checked_at":"2025-07-23T02:00:09.312Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["http","http-client","http-server","httpclient","httpd","rust","wasm","webassembly"],"created_at":"2024-11-12T18:06:52.671Z","updated_at":"2025-07-23T09:08:03.382Z","avatar_url":"https://github.com/WasmEdge.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WasmEdge Hyper Demo\n\nIn this project, we demonstrate how to use **hyper** and **tokio** to build async http client in WebAssembly and execute it using [WasmEdge](https://github.com/WasmEdge/WasmEdge).\n\n## Why tokio in WasmEdge?\n\nThere are growing demands to perform network requests in WASM and cloud computing. But it would be inefficient to perform network requests synchronously so we need async in WASM. \n\nAs tokio is widely accepted, we can bring many projects that depend on tokio to WASM if we can port tokio into WASM. After that, the developers can have async functions in WASM as well as efficient programs.\n\nWith the help of tokio support of WasmEdge, the developers can compile the projects that use tokio into WASM and execute it using WasmEdge.\n\n## Quickstart with Docker\n\nThe easiest way to get started is to use a version of Docker Desktop or Docker CLI with Wasm support.\n\n* [Install Docker Desktop + Wasm (Beta)](https://docs.docker.com/desktop/wasm/)\n* [Install Docker CLI + Wasm](https://github.com/chris-crone/wasm-day-na-22/tree/main/server)\n\nBuild all the examples using Docker. There is no need to install Rust or WasmEdge here since Docker sets it all up for you.\n\n```bash\ndocker compose build\n```\n\nThen, you just need to type one command to run each example.\n\n```bash\n# To run the HTTP client example\n$ docker compose run --no-TTY client\n... ...\n\n# To run the HTTP server\n$ docker compose run --no-TTY -p 8080:8080 server\n... ...\n# Test the HTTP server using curl\n$ curl http://localhost:8080/echo -X POST -d \"WasmEdge\"\nWasmEdge\n\n# To run the Warp HTTP server\n$ docker compose run --no-TTY -p 8080:8080 server-warp\n... ...\n# Test the HTTP server using curl\n$ curl http://localhost:8080/echo -X POST -d \"WasmEdge\"\nWasmEdge\n\n```\n\nIt runs both the client and server examples in this repo. See the [Dockerfile](Dockerfile) and [docker-compose.yml](docker-compose.yml) files.  The [client example](client) will run and quit upon completion. The [server example](server) starts a server that listens for incoming HTTP requests, and you can interact with it through `curl`.\n\nHowever, if you want to build and run the examples step by step on your own system. Follow the detailed instructions below.\n\n## Prerequisites\n\nWe need install rust and wasm target first.\n\n```bash \n# install rust \ncurl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh\nsource $HOME/.cargo/env\n\n# install wasm target \nrustup target add wasm32-wasi\n```\n\nThen install the WasmEdge. You will need `all` extensions to run the [HTTP server with Tensorflow](server-tflite/README.md) example.\n\n```bash\ncurl -sSf https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install.sh | bash -s -- -e all\nsource $HOME/.wasmedge/env\n```\n\n## Add dependencies in **Cargo.toml**\n\nIn this project, we add tokio and reqwest as dependencies.\n\n```toml\n[dependencies]\nhyper_wasi = { version = \"0.15\", features = [\"full\"]}\ntokio_wasi = { version = \"1\", features = [\"rt\", \"macros\", \"net\", \"time\", \"io-util\"]}\n```\n\n## Examples\n\nDetails about the example apps are as below.\n\n* [HTTP client](client/README.md) \n* [HTTP server](server/README.md) \n* [HTTP server in warp framework](server-warp/README.md) \n* [HTTP server with Tensorflow](server-tflite/README.md) \n\n# FAQ\n\n## use of unstable library feature 'wasi_ext'\n\nIf you are using rustc 1.64, you may encounter this error. There are two options:\n\n1. Update rustc to newer version. Validated versions are `1.65` and `1.59`.\n2. Add `#![feature(wasi_ext)]` to the top of `mio/src/lib.rs`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwasmedge%2Fwasmedge_hyper_demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwasmedge%2Fwasmedge_hyper_demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwasmedge%2Fwasmedge_hyper_demo/lists"}