---
title: Adapt
summary: Adapt allows an http.Handler to be used as an fsthttp.Handler.
url: https://www.fastly.com/documentation/reference/compute/sdks/go/compute-sdk-go/fsthttp/fn.Adapt/
---

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

```go
func Adapt(h http.Handler) Handler
```

Adapt allows an http.Handler to be used as an fsthttp.Handler.

Because the Request and ResponseWriter types are not exactly the same
as ones in net/http, helper accessor functions exist to extract the
fsthttp values from the request context.

**Parameters**

- `h`: `http.Handler`

**Returns**

`Handler`
