package ohttp-piaf

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Ohttp_piaf.RelaySource

A relay, which forwards to one gateway.

Sourceval handler : ?config:Piaf.Config.t -> Eio_unix.Stdenv.base -> Ohttp.Service.Relay.t -> gateway:Uri.t -> 'ctx handler

handler env relay ~gateway forwards every POST of an Encapsulated Request to gateway, and its answer back, through Ohttp.Service.Relay. Nothing else about the client goes to the gateway: not its address, and no field but the content type. A gateway that does not answer gives a 502, and so does one whose answer is longer than the max_response_size of relay.

A request longer than the max_request_size of relay is answered with Ohttp.Service.content_too_large, and one that arrives while max_in_flight are being forwarded with Ohttp.Service.busy. The requests in flight are counted in relay, which is meant to serve every request.