Introduction

    If you’re new to writing Traffic Server plugins, Getting Started should be your starting point. provides details about plugins that work on HTTP headers, while HTTP Transformations explains how to write a plugin that transforms or scans the body of an HTTP response. provides essential information if you want to support your own protocol on Traffic Server.

    For a reference to the C API functions and types that your plugin will use, refer to the API Reference.

    Below is a section-by-section breakdown of this guide:

    The header file directory structure, where to find headers for particular tasks.

    Getting Started

    How to compile and load plugins. Walks through a simple “hello world” example; explains how to initialize and register plugins. Basic structures that all plugins use: events, continuations, and how to hook on to Traffic Server processes. Detailed explication of a sample denylisting plugin.

    Header-Based Plugin Examples

    Detailed explanation about writing plugins that work on HTTP headers; discusses sample denylisting and basic authorization plugins.

    Detailed explanation of the null_transform example; also discusses , VIOs, and IO buffers.

    New Protocol Plugins

    Detailed explanation of a sample protocol plugin that supports a synthetic protocol. Discusses VConnections and mutexes, as well as the new NetConnection, DNS lookup, logging, and cache APIs.

    The remaining sections comprise the API function reference and are organized by function type:

    Details error-writing and tracing functions, thread functions, and Traffic Server API versions of the and fopen families. The Traffic Server API versions overcome various C library limitations.

    Hooks and Transactions

    Functions in this chapter hook your plugin to Traffic Server HTTP processes.

    Mutexes

    Continuations provide the basic callback mechanism and data abstractions used in Traffic Server.

    Plugin Configuration

    Describes how to use TSActions and the TSDNSLookup API.

    IO

    Describes how to use the Traffic Server IO interfaces: , TSVIO, TSIOBuffer, TSNetVConnection, the Cache API.

    These functions enable you to set up a configuration interface for plugins, access installed plugin files, and set up plugin licensing.

    Adding Statistics

    These functions add statistics to your plugin.

    Traffic Server API Function Documentation.