承接 ileadu/laravel-octane-unix-socket-support 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

ileadu/laravel-octane-unix-socket-support

Composer 安装命令:

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

包简介

Add support for UNIX socket in Octane Swoole server

README 文档

README

Add UNIX Domain Socket (UDS) support to 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

  • ✅ 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

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

This package applies the patch from laravel/octane#1032 and enhances the existing --host option to support UNIX socket paths

🚀 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

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?

🔥 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

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

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

📄 License

MIT

🙏 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.

ileadu/laravel-octane-unix-socket-support 适用场景与选型建议

ileadu/laravel-octane-unix-socket-support 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 74 次下载、GitHub Stars 达 5, 最近一次更新时间为 2025 年 07 月 10 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「laravel」 「swoole」 「octane」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 ileadu/laravel-octane-unix-socket-support 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 ileadu/laravel-octane-unix-socket-support 我们能提供哪些服务?
定制开发 / 二次开发

基于 ileadu/laravel-octane-unix-socket-support 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 74
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 5
  • 点击次数: 18
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 5
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-07-10