You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The **`createWebsocketHandoff()`** function creates a Response instance which informs Fastly to pass the original Request through Websocket, to the declared backend.
11
+
12
+
## Syntax
13
+
14
+
```js
15
+
createWebsocketHandoff(request, backend)
16
+
```
17
+
18
+
### Parameters
19
+
20
+
-`request`_: Request_
21
+
- The request to pass through Websocket.
22
+
-`backend`_: string_
23
+
- The name of the backend that Websocket should send the request to.
24
+
- The name has to be between 1 and 254 characters inclusive.
25
+
- Throws a [`TypeError`](../globals/TypeError/TypeError.mdx) if the value is not valid. I.E. The value is null, undefined, an empty string or a string with more than 254 characters.
26
+
27
+
### Return value
28
+
29
+
A Response instance is returned, which can then be used via `event.respondWith`.
30
+
31
+
## Examples
32
+
33
+
In this example application requests to the path `/stream` and sent handled via Websocket.
0 commit comments