---
title: Websocket
summary: Websocket passes the WebSocket directly to a backend.
url: https://www.fastly.com/documentation/reference/compute/sdks/go/compute-sdk-go/x/exp/handoff/fn.Websocket/
---

**Kind:** Function  
**Module:** [handoff](https://www.fastly.com/documentation/reference/compute/sdks/go/compute-sdk-go/x/exp/handoff/)  
**Package:** compute-sdk-go v1.11.0  
**Source:** https://github.com/fastly/compute-sdk-go/blob/d6bf71b04516ed72d6018cab6fff701a865f86e5/x/exp/handoff/handoff.go#L14

```go
func Websocket(backend string) error
```

Websocket passes the WebSocket directly to a backend.

This can only be used on services that have the WebSockets feature
enabled and on requests that are valid WebSocket requests.  The sending
completes in the background.

Once this method has been called, no other response can be sent to this
request, and the application can exit without affecting the send.

**Parameters**

- `backend`: `string`

**Returns**

`error`
