FetchEvent
This is the event type for fetch events. It contains information about the fetch, including the request and how the receiver will treat the response.
It provides the event.respondWith() method, which allows us to provide a response to this fetch.
Instance properties
FetchEvent.requestreadonly- : The
Requestthat was received by the application.
- : The
FetchEvent.clientreadonly- : Information about the downstream client that made the request. While these fields are always defined on Compute, they may be null when not available in testing environments such as Viceroy.
FetchEvent.client.addressreadonly- : A string representation of the IPv4 or IPv6 address of the downstream client.
FetchEvent.client.georeadonly- : Either
null, or a geolocation dictionary corresponding to the IP address of the downstream client.
- : Either
FetchEvent.client.tlsJA3MD5readonly- : Either
nullor a string representation of the JA3 hash of the TLS ClientHello message.
- : Either
FetchEvent.client.tlsCipherOpensslNamereadonly- : Either
nullor a string representation of the cipher suite used to secure the client TLS connection.
- : Either
FetchEvent.client.tlsProtocolreadonly- : Either
nullor a string representation of the TLS protocol version used to secure the client TLS connection.
- : Either
FetchEvent.client.tlsClientCertificatereadonly- : Either
nullor an ArrayBuffer containing the raw client certificate in the mutual TLS handshake message. It is in PEM format. Returns an empty ArrayBuffer if this is not mTLS or available.
- : Either
FetchEvent.client.tlsClientHelloreadonly- : Either
nullor an ArrayBuffer containing the raw bytes sent by the client in the TLS ClientHello message.
- : Either
FetchEvent.serverreadonly- : Information about the server receiving the request for the Fastly Compute service.
FetchEvent.server.addressreadonly- : A string representation of the IPv4 or IPv6 address of the server which received the request.
Instance methods
FetchEvent.respondWith()- : Provide (a promise for) a response for this request.
FetchEvent.waitUntil()- : Extends the lifetime of the event. Used to notify the host environment of tasks that extend beyond the returning of a response, such as streaming and caching.