Skip to content

Add support for UNIX socket in Octane Swoole server #1032

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

ileadu
Copy link

@ileadu ileadu commented Jul 6, 2025

This pull request adds support for running the Laravel Octane Swoole server via a UNIX domain socket (UDS), instead of the default TCP host/port combination.

Benefit to end users:
Using a UNIX socket can offer better performance and security when deploying Laravel behind a local reverse proxy like Nginx. It avoids unnecessary TCP overhead, simplifies internal routing, and reduces the potential attack surface by keeping inter-process communication on the filesystem.

Why it doesn’t break existing features:

This change is non-breaking and fully backward compatible.

If the sock is not set, Octane continues to use the standard host and port settings.

How it improves developer experience:

Developers using Swoole in Docker or on Linux servers now have the flexibility to bind the Octane server to a UNIX socket file.

This allows easier integration with services like Nginx (fastcgi_pass or proxy_pass to unix:/...) and enhances performance in high-throughput environments.

Notes:

This feature is ignored on Windows, as UNIX domain sockets are not supported there.

Let me know if you’d like help documentation updates to go along with the feature.

#1031

@taylorotwell
Copy link
Member

Thanks for your pull request to Laravel!

Unfortunately, I'm going to delay merging this code for now. To preserve our ability to adequately maintain the framework, we need to be very careful regarding the amount of code we include.

If applicable, please consider releasing your code as a package so that the community can still take advantage of your contributions!

@Cluster2a
Copy link

I don’t understand - meaningful improvements to the framework aren’t being merged, yet something like the FrankenPHP file watcher gets accepted.

@Cluster2a
Copy link

@ileadu, any chances, this can be provided as a package?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants