PHPackages                             ileadu/laravel-octane-unix-socket-support - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. ileadu/laravel-octane-unix-socket-support

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

ileadu/laravel-octane-unix-socket-support
=========================================

Add support for UNIX socket in Octane Swoole server

2.0.0(1mo ago)574MIT

Since Jul 11Pushed 1mo agoCompare

[ Source](https://github.com/ileadu/laravel-octane-unix-socket-support)[ Packagist](https://packagist.org/packages/ileadu/laravel-octane-unix-socket-support)[ RSS](/packages/ileadu-laravel-octane-unix-socket-support/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (4)Versions (3)Used By (0)

Laravel Octane – UNIX Socket Support for Swoole
===============================================

[](#laravel-octane--unix-socket-support-for-swoole)

Add UNIX Domain Socket (UDS) support to [Laravel Octane](https://github.com/laravel/octane) when using the Swoole server. This enables high-performance, local-only communication between Octane and Nginx (or other reverse proxies), ideal for Docker or Linux server deployments.

✨ Features
----------

[](#-features)

- ✅ Supports UNIX Domain Socket (UDS) via `--host=/tmp/octane.sock`
- ✅ Automatically detects socket paths and binds Swoole accordingly
- ✅ Fully backward-compatible (TCP continues to work if UDS is not used)
- ✅ Optimized for Linux and Docker environments
- 🚫 Ignored on Windows (no UDS support)

📦 Installation
--------------

[](#-installation)

Due to Composer limitations, patches defined inside packages like this one are **not automatically applied**. To activate the UNIX socket support, you must manually define the patch in your Laravel project's `composer.json`.

Add the following to the `extra.patches` section in your root `composer.json`:

```
"extra": {
  "laravel": {
    "dont-discover": []
  },
  "patches": {
    "laravel/octane": {
      "Add UNIX socket support to Octane": "vendor/ileadu/laravel-octane-unix-socket-support/patches/octane-unix-socket.patch"
    }
  }
}
```

To apply this patch to Laravel Octane v2.10+

```
composer require ileadu/laravel-octane-unix-socket-support
```

💡 About This Patch
------------------

[](#-about-this-patch)

This package applies the patch from [laravel/octane#1032](https://github.com/laravel/octane/pull/1032) and enhances the existing `--host` option to support UNIX socket paths

🚀 Usage
-------

[](#-usage)

Start Octane with Swoole and a UNIX socket:

```
php artisan octane:start --server=swoole --host=/tmp/octane.sock
```

If the `--host` value is a valid file path (e.g. starts with `/` and ends with `.sock`), Octane will automatically use a UNIX domain socket instead of TCP.

🔧 Nginx Integration Example
---------------------------

[](#-nginx-integration-example)

Example nginx.conf:

```
location /index.php {
    try_files /not_exists @octane;
}

location / {
    try_files $uri $uri/ @octane;
}

location @octane {
    proxy_http_version 1.1;
    proxy_set_header Host $http_host;
    proxy_set_header Scheme $scheme;
    proxy_set_header SERVER_PORT $server_port;
    proxy_set_header REMOTE_ADDR $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection $connection_upgrade;

    proxy_pass http://unix:/tmp/octane.sock:$request_uri;
}
```

💡 Why Use UNIX Domain Sockets?
------------------------------

[](#-why-use-unix-domain-sockets)

🔥 Faster than TCP for **local** communication (less overhead)

🔒 More secure – no external port exposure

🐳 Perfect for Docker or systemd socket-activation setups

🧩 Clean and easy integration with Nginx via proxy\_pass

❓ Fallback Behavior
-------------------

[](#-fallback-behavior)

If `--host` is a UNIX socket path → Swoole binds to the socket.

If `--host` is a hostname or IP → Octane behaves normally (TCP mode).

Patch is ignored on Windows platforms.

📝 Patch Details
---------------

[](#-patch-details)

This package includes a patch against Laravel Octane v2.10.0, enhancing the `--host` option to support UNIX socket binding for Swoole.

📄 License
---------

[](#-license)

MIT

🙏 Credits
---------

[](#-credits)

Thanks to the Laravel and Octane teams for building an incredible high-performance foundation. This patch is a community-contributed improvement for specific deployment scenarios.

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance90

Actively maintained with recent releases

Popularity15

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~259 days

Total

2

Last Release

47d ago

Major Versions

1.0.0 → 2.0.02026-03-27

### Community

Maintainers

![](https://www.gravatar.com/avatar/0ca8e9e9c26e998166c5afce213bae58a2eee3d778a0c20a9d035a8ba2f3c671?d=identicon)[ileadu](/maintainers/ileadu)

---

Top Contributors

[![ileadu](https://avatars.githubusercontent.com/u/237095?v=4)](https://github.com/ileadu "ileadu (4 commits)")

---

Tags

laravelswooleoctane

### Embed Badge

![Health badge](/badges/ileadu-laravel-octane-unix-socket-support/health.svg)

```
[![Health](https://phpackages.com/badges/ileadu-laravel-octane-unix-socket-support/health.svg)](https://phpackages.com/packages/ileadu-laravel-octane-unix-socket-support)
```

###  Alternatives

[laravel/octane

Supercharge your Laravel application's performance.

4.0k21.5M159](/packages/laravel-octane)[garveen/laravoole

Get 10x performance for Laravel on Swoole or Workerman

8834.9k](/packages/garveen-laravoole)[renoki-co/octane-exporter

Export Laravel Octane metrics using this Prometheus exporter.

30128.9k](/packages/renoki-co-octane-exporter)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
