Skip to content

struct

KeyProxy

pub struct KeyProxy {
    /* private fields */
}

Forwards GETs under one upstream URL, adding the key.

Methods

new

pub fn new(upstream: &str, key: Key) -> KeyProxy

A proxy that forwards to upstream (a trailing / is dropped), adding key to each request.

request

pub fn request(&self, path: &str, query: &str, secret: &str) -> Option<Request>

The upstream request for a path and query under this route. secret is the key's value. None if the path tries to leave the upstream.

route

pub fn route(self, cfg: &mut ServiceConfig, path: &str)

Serve this proxy at path and everything under it.

Trait implementations