-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Change minimal port number to 0 (unix socket) #2452
Conversation
Can I ask why you are listening on port 0 (ie socket) ??? Aren't you just inviting trouble? This port is mostly blocked because of the security implications as it's intended for system level stuff? |
Unix(7) sockets have no concept of port, so the function which checks for port returns 0 (or null, nothing). It's not the same as TCP or UDP port 0 (it's not using TCP/IP at all actually).
It's safer, addressed by file path, not exposed to the network, access is controlled by filesystem permissions (user/group); and it's faster, as it has no TCP/IP overhead. I expose it to the internet through a load balancer forwarding traffic to this unix socket. Relevant lines from Grav's Configuration - Info page in admin panel:
|
Issue is still present in Grav 1.6.7.
|
Thanks for the clarification ! What you're doing is badass. 🚀 Perhaps a compromise would be to somehow skip the Uri port filter altogether somewhere upstream like here, when the scheme is |
I'm ok merging this when/if the upstream repos merge it (which will be required for this to work correctly in Grav anyway). |
The upstream merged fixes. |
Great we’ll get this merged too. |
Listening on an unix socket reports port number 0, which is interpreted as an invalid argument.
Same issue exists in vendor libraries used by Grav.
guzzle/psr7#270
Nyholm/psr7#115
One of them caused whole website to crash with HTTP 503 error, after updating from 1.5.8 to 1.6.3.