---
name: "TSHttpTxnIntercept"
section: "3ts"
platform: "linux"
package: "trafficserver-dev"
version: "9.2.5+ds-0+deb12u4"
release: "Debian 12 (Bookworm)"
platforms: ["linux"]
url: "https://new.carta.tech/TSHttpTxnIntercept"
---

# TSHttpTxnIntercept(3ts)

allows a plugin take over the servicing of the request as though it was the origin server

## NAME

TSHttpTxnIntercept - allows a plugin take over the servicing of the request as though it was the origin server

## SYNOPSIS

```
#include <ts/ts.h>
```

- **void TSHttpTxnIntercept(*TSCont* contp, *TSHttpTxn* txnp)**

  ## DESCRIPTION

*contp* will be sent *TS\_EVENT\_NET\_ACCEPT*. The edata passed with *TS\_EVENT\_NET\_ACCEPT* is an *TSVConn* just as it would be for a normal accept. The plugin must act as if it is an HTTP server and read the HTTP request and body off the *TSVConn* and send an HTTP response header and body.

*TSHttpTxnIntercept()* must be called be called from only *TS\_HTTP\_READ\_REQUEST\_HDR\_HOOK*.  Using *TSHttpTxnIntercept* will bypass the Traffic Server cache.  If response sent by the plugin should be cached, use *TSHttpTxnServerIntercept()* instead. *TSHttpTxnIntercept()* primary use is allow plugins to serve data about their functioning directly.

*TSHttpTxnIntercept()* must only be called once per transaction.

## COPYRIGHT

2026, dev@trafficserver.apache.org
