Skip to content

rongfengliang/nginx-unit-wasm-learning

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nginx-unit wasm learning

build wasm

  • install wasm plugins
rustup target add wasm32-wasi
  • command
cd wasm/wasm_on_unit
cargo build --target wasm32-wasi

config unit

  • config

inside unit container

curl -X PUT --data-binary '{
      "listeners": {
          "0.0.0.0:8080": {
              "pass": "applications/wasm"
          }
      },

      "applications": {
          "wasm": {
              "type": "wasm",
              "module": "/www/wasm_on_unit.wasm",
              "request_handler": "uwr_request_handler",
              "malloc_handler": "luw_malloc_handler",
              "free_handler": "luw_free_handler",
              "module_init_handler": "uwr_module_init_handler",
              "module_end_handler": "uwr_module_end_handler"
          }
      }
  }' --unix-socket /var/run/control.unit.sock http://localhost/config/
  • check
curl -i http://localhost:8080

About

nginx-unit-wasm-learning

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published