From 99b5155c556535f7d7503c5d5e0493b4b87c0af1 Mon Sep 17 00:00:00 2001 From: Trevor Elliott Date: Tue, 7 Nov 2023 14:10:21 -0800 Subject: [PATCH] Regenerate proxy.md --- proxy.md | 103 +++++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 89 insertions(+), 14 deletions(-) diff --git a/proxy.md b/proxy.md index 8754a39..6fa83b8 100644 --- a/proxy.md +++ b/proxy.md @@ -644,6 +644,9 @@ their headers, trailers, and bodies.

#### `type output-stream` [`output-stream`](#output_stream)

+#### `type stream-error` +[`error`](#error) +

#### `type pollable` [`pollable`](#pollable)

@@ -670,16 +673,71 @@ their headers, trailers, and bodies.

  • HTTPS
  • other: string
  • -

    variant error

    -

    TODO: perhaps better align with HTTP semantics? -This type enumerates the different kinds of errors that may occur when -initially returning a response.

    +

    record DNS-error-payload

    +

    Defines the case payload type for DNS-error above:

    +
    Record Fields
    + +

    record TLS-alert-received-payload

    +

    Defines the case payload type for TLS-alert-received above:

    +
    Record Fields
    + +

    record HTTP-request-error-payload

    +

    Defines the case payload type for HTTP-request-error above:

    +
    Record Fields
    + +

    record field-size-payload

    +

    Defines the case payload type for HTTP-response-{header,trailer}-size above:

    +
    Record Fields
    + +

    variant error-code

    +

    The cases of this variant correspond to the IANA HTTP Proxy Error Types: +https://www.iana.org/assignments/http-proxy-status/http-proxy-status.xhtml#table-http-proxy-error-types

    Variant Cases

    variant header-error

    This type enumerates the different kinds of errors that may occur when @@ -728,6 +786,23 @@ so they are provided as a list of bytes.

    resource future-incoming-response


    Functions

    +

    http-error-code: func

    +

    Attempts to extract a http-related error from the stream error +provided.

    +

    Stream operations which return stream-error::last-operation-failed have +a payload with more information about the operation that failed. This +payload can be passed through to this function to see if there's +http-related information about the error to return.

    +

    Note that this function is fallible because not all stream-related errors +are http-related errors.

    +
    Params
    + +
    Return values
    +

    [constructor]fields: func

    Construct an empty HTTP Fields.

    Return values
    @@ -1106,7 +1181,7 @@ implementation determine how to respond with an HTTP error response.

    Params

    [method]incoming-response.status: func

    Returns the status code from the incoming response.

    @@ -1198,7 +1273,7 @@ trailers were present in the body.

    Return values

    [constructor]outgoing-response: func

    Construct an outgoing-response.

    @@ -1314,7 +1389,7 @@ but those will be reported by the incoming-body
    Return values

    Import interface wasi:http/outgoing-handler

    This interface defines a handler of outgoing HTTP Requests. It should be @@ -1330,8 +1405,8 @@ imported by components which wish to make HTTP Requests.

    #### `type future-incoming-response` [`future-incoming-response`](#future_incoming_response)

    -#### `type error` -[`error`](#error) +#### `type error-code` +[`error-code`](#error_code)

    ----

    Functions

    @@ -1351,7 +1426,7 @@ through the future-incoming-response
    Return values

    Export interface wasi:http/incoming-handler