PHPackages                             wafio/wafio-client-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Security](/categories/security)
4. /
5. wafio/wafio-client-php

ActiveLibrary[Security](/categories/security)

wafio/wafio-client-php
======================

PHP client for Wafio WAF TCP mTLS (analyze requests, check block). Feature parity with Node.js and Go clients.

v1.0.0(2mo ago)01MITPHPPHP &gt;=7.4

Since Feb 26Pushed 2mo agoCompare

[ Source](https://github.com/Wafio/wafio-client-php)[ Packagist](https://packagist.org/packages/wafio/wafio-client-php)[ Docs](https://github.com/Wafio/wafio-client-php)[ RSS](/packages/wafio-wafio-client-php/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

wafio-client-php
================

[](#wafio-client-php)

A production-ready **PHP client** for **Wafio** WAF over TCP mTLS. Analyze incoming HTTP requests and check whether a client key is currently blocked.

**Works with:**

- ✅ PHP 8.1+
- ✅ Laravel, Symfony, and plain PHP
- ✅ Full type hints and PHPDoc

**Features:**

- **Fail-open by default** (circuit breaker behavior)
- **FPM-safe connection model** (connect per operation, then close)
- **mTLS authentication** with server verification
- **Framework-agnostic helpers** for request-to-analyze conversion
- **Feature parity** with TypeScript and Go clients (`analyze`, `checkBlock`, `getTierLimits`)

Installation
------------

[](#installation)

```
composer require wafio/wafio-client-php
```

Monorepo local path example:

```
{
  "repositories": [
    {
      "type": "path",
      "url": "packages/wafio-client-php"
    }
  ],
  "require": {
    "wafio/wafio-client-php": "*"
  }
}
```

Then run:

```
composer install
```

Quick Start
-----------

[](#quick-start)

### 1. Prepare mTLS credentials

[](#1-prepare-mtls-credentials)

Generate or download your project mTLS key from the Wafio dashboard and save it as JSON (for example `mtls-credentials.json`).

Expected fields:

```
{
  "ca_pem": "-----BEGIN CERTIFICATE-----...",
  "client_cert_pem": "-----BEGIN CERTIFICATE-----...",
  "client_key_pem": "-----BEGIN PRIVATE KEY-----...",
  "tcp_url": "tcp.wafio.cloud:9443"
}
```

### 2. Create a client and analyze a request

[](#2-create-a-client-and-analyze-a-request)

```
