Skip to content

Commit

Permalink
feat: support backend property hostcalls (#1002)
Browse files Browse the repository at this point in the history
  • Loading branch information
guybedford authored Oct 11, 2024
1 parent 4c2b95f commit 1d9f91a
Show file tree
Hide file tree
Showing 24 changed files with 1,169 additions and 60 deletions.
8 changes: 4 additions & 4 deletions documentation/docs/backend/Backend/Backend.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,8 @@ async function app() {
firstByteTimeout: 15000,
betweenBytesTimeout: 10000,
useSSL: true,
sslMinVersion: 1.3,
sslMaxVersion: 1.3,
tlsMinVersion: 1.3,
tlsMaxVersion: 1.3,
});
return fetch('https://www.fastly.com/', {
backend // Here we are configuring this request to use the backend from above.
Expand Down Expand Up @@ -238,8 +238,8 @@ async function app() {
firstByteTimeout: 15000,
betweenBytesTimeout: 10000,
useSSL: true,
sslMinVersion: 1.3,
sslMaxVersion: 1.3,
tlsMinVersion: 1.3,
tlsMaxVersion: 1.3,
});
return fetch('https://www.fastly.com/', {
backend // Here we are configuring this request to use the backend from above.
Expand Down
6 changes: 6 additions & 0 deletions documentation/docs/backend/Backend/health.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ pagination_prev: null

# Backend.health()

:::info

This method is deprecated, use [`Backend.prototype.health`](./prototype/health.mdx) instead.

:::

The **`Backend.health()`** method returns a string representing the health of the given Backend instance.

## Syntax
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
hide_title: false
hide_table_of_contents: false
pagination_next: null
pagination_prev: null
---

# Backend.betweenBytesTimeout

The read-only **`betweenBytesTimeout`** property of a `Backend` instance is an integer number
providing the between bytes timeout for this backend in milliseconds.

When not set or in environments that do not support this property (such as Viceroy), `null`
may be returned.

## Value

A `number` or `null`.
18 changes: 18 additions & 0 deletions documentation/docs/backend/Backend/prototype/connectTimeout.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
hide_title: false
hide_table_of_contents: false
pagination_next: null
pagination_prev: null
---

# Backend.connectTimeout

The read-only **`connectTimeout`** property of a `Backend` instance is an integer number
providing the connect timeout for this backend in milliseconds.

When not set or in environments that do not support this property (such as Viceroy), `null`
may be returned.

## Value

A `number` or `null`.
18 changes: 18 additions & 0 deletions documentation/docs/backend/Backend/prototype/firstByteTimeout.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
hide_title: false
hide_table_of_contents: false
pagination_next: null
pagination_prev: null
---

# Backend.firstByteTimeout

The read-only **`firstByteTimeout`** property of a `Backend` instance is an integer number
providing the first byte timeout for this backend in milliseconds.

When not set or in environments that do not support this property (such as Viceroy), `null`
may be returned.

## Value

A `number` or `null`.
25 changes: 25 additions & 0 deletions documentation/docs/backend/Backend/prototype/health.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
hide_title: false
hide_table_of_contents: false
pagination_next: null
pagination_prev: null
---

# Backend.prototype.health()

The **`Backend.prototype.health()`** method returns a string representing the health of the given Backend instance.

## Syntax

```js
health()
```

### Return value

A string representing the health of the specified Backend value.

Possible values are:
- `"healthy"` - The backend's health check has succeeded, indicating the backend is working as expected and should receive requests.
- `"unhealthy"` - The backend's health check has failed, indicating the backend is not working as expected and should not receive requests.
- `"unknown"` - The backend does not have a health check configured.
15 changes: 15 additions & 0 deletions documentation/docs/backend/Backend/prototype/hostOverride.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
hide_title: false
hide_table_of_contents: false
pagination_next: null
pagination_prev: null
---

# Backend.hostOverride

The read-only **`hostOverride`** property of a `Backend` instance is the host header
override string used when sending requests to this backend.

## Value

A `string`.
15 changes: 15 additions & 0 deletions documentation/docs/backend/Backend/prototype/httpKeepaliveTime.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
hide_title: false
hide_table_of_contents: false
pagination_next: null
pagination_prev: null
---

# Backend.httpKeepaliveTime

The read-only **`httpKeepaliveTime`** property of a `Backend` instance is the HTTP keepalive
time for this backend in milliseconds, or 0 if no keepalive is set.

## Value

A `number`.
15 changes: 15 additions & 0 deletions documentation/docs/backend/Backend/prototype/isDynamic.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
hide_title: false
hide_table_of_contents: false
pagination_next: null
pagination_prev: null
---

# Backend.isDynamic

The read-only **`isDynamic`** property of a `Backend` instance is a boolean
indicating if the backend was dynamically created for this service.

## Value

A `boolean`.
15 changes: 15 additions & 0 deletions documentation/docs/backend/Backend/prototype/isSSL.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
hide_title: false
hide_table_of_contents: false
pagination_next: null
pagination_prev: null
---

# Backend.isSSL

The read-only **`isSSL`** property of a `Backend` instance is a boolean
indicating if the backend is using an SSL connection.

## Value

A `boolean`.
15 changes: 15 additions & 0 deletions documentation/docs/backend/Backend/prototype/port.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
hide_title: false
hide_table_of_contents: false
pagination_next: null
pagination_prev: null
---

# Backend.port

The read-only **`port`** property of a `Backend` instance is the port number
of this backend.

## Value

A `number`.
15 changes: 15 additions & 0 deletions documentation/docs/backend/Backend/prototype/target.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
hide_title: false
hide_table_of_contents: false
pagination_next: null
pagination_prev: null
---

# Backend.target

The read-only **`target`** property of a `Backend` instance is the host string
this backend is configured to use.

## Value

A `string`.
23 changes: 23 additions & 0 deletions documentation/docs/backend/Backend/prototype/tcpKeepalive.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
hide_title: false
hide_table_of_contents: false
pagination_next: null
pagination_prev: null
---

# Backend.tcpKeepalive

The read-only **`tcpKeepalive`** property of a `Backend` instance returns an object providing
the TCP keepalive configuration, if any, otherwise returning `null` if TCP keepalive is not enabled.

This object has the following properties:
- `timeSecs` _: number or null.
- Configure how long to wait after the last sent data over the TCP connection before starting to send TCP keepalive probes.
- `intervalSecs` _: number or null.
- Configure how long to wait between each TCP keepalive probe sent to the backend to determine if it is still active.
- `probes` _: number or null.
- Number of probes to send to the backend before it is considered dead.

## Value

A `Object` or `null`.
18 changes: 18 additions & 0 deletions documentation/docs/backend/Backend/prototype/tlsMaxVersion.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
hide_title: false
hide_table_of_contents: false
pagination_next: null
pagination_prev: null
---

# Backend.tlsMaxVersion

The read-only **`tlsMaxVersion`** property of a `Backend` instance is the max TLS version
it is configured to use, as a number, either `1.0`, `1.1`, `1.2`, or `1.3`.

When not used, or for environments that do not support this feature, such as Viceroy, `null`
may be returned.

## Value

A `number` or `null`.
18 changes: 18 additions & 0 deletions documentation/docs/backend/Backend/prototype/tlsMinVersion.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
hide_title: false
hide_table_of_contents: false
pagination_next: null
pagination_prev: null
---

# Backend.tlsMinVersion

The read-only **`tlsMinVersion`** property of a `Backend` instance is the max TLS version
it is configured to use, as a number, either `1.0`, `1.1`, `1.2`, or `1.3`.

When not used, or for environments that do not support this feature, such as Viceroy, `null`
may be returned.

## Value

A `number` or `null`.
Loading

0 comments on commit 1d9f91a

Please sign in to comment.