From e697eb86cee9289997d405945071d07e356160c8 Mon Sep 17 00:00:00 2001 From: Daniel Pasch-Sannapiu Date: Sat, 6 Jul 2024 14:07:38 +0200 Subject: [PATCH] Only listen on 127.0.0.1 not all interfaces This is a security risk, because you are exposing your application to other devices on your network if your device has no firewall configured. More importantly though it allows root free running of symfony and on macOS you will no longer get an annoying popup to allow incoming connections. --- local/process/listener.go | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/local/process/listener.go b/local/process/listener.go index 531b2856..02ec7b81 100644 --- a/local/process/listener.go +++ b/local/process/listener.go @@ -39,15 +39,9 @@ func CreateListener(port, preferredPort int) (net.Listener, int, error) { max = 1 } for { - // we really want to test availability on 127.0.0.1 ln, err = net.Listen("tcp", "127.0.0.1:"+strconv.Itoa(tryPort)) if err == nil { - ln.Close() - // but then, we want to listen to as many local IP's as possible - ln, err = net.Listen("tcp", ":"+strconv.Itoa(tryPort)) - if err == nil { - break - } + break } if port > 0 { return nil, 0, errors.Wrapf(err, "unable to listen on port %d", port) pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy