caddyfastlike

package module
v0.0.0-...-0d44f65 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 2, 2020 License: MPL-2.0 Imports: 5 Imported by: 0

README

caddy-fastlike

A Caddy v2 plugin that can run WebAssembly code via fastlike

try it out

Extremely beta. But you can try it out:

# Build the example wasm
$ cd testdata && cargo build

# Get xcaddy and use it to build this plugin
$ go get -u github.com/caddyserver/xcaddy/cmd/xcaddy
$ env CGO_ENABLED=1 xcaddy build --with fastlike.dev/caddy-fastlike=$(pwd)

# Run caddy with the example config
$ ./caddy run --config example-config.json

Now all requests to localhost:2105 will run through the wasm module via fastlike. Try http://localhost:2105/teapot for a static response.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Module

type Module struct {
	Wasm   string `json:"wasm"`
	Warmup int    `json:"warmup"`
	// contains filtered or unexported fields
}

func (Module) CaddyModule

func (m Module) CaddyModule() caddy.ModuleInfo

func (*Module) Provision

func (m *Module) Provision(ctx caddy.Context) error

func (*Module) ServeHTTP

func (m *Module) ServeHTTP(w http.ResponseWriter, r *http.Request, next caddyhttp.Handler) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL