10000 Merge pull request #494 from gempir/bind-address · shyim/symfony-cli@7c4fca5 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7c4fca5

Browse files
authored
Merge pull request symfony-cli#494 from gempir/bind-address
Only listen on 127.0.0.1 not all addresses
2 parents 4b1a8d0 + e697eb8 commit 7c4fca5

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

local/process/listener.go

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,9 @@ func CreateListener(port, preferredPort int) (net.Listener, int, error) {
3939
max = 1
4040
}
4141
for {
42-
// we really want to test availability on 127.0.0.1
4342
ln, err = net.Listen("tcp", "127.0.0.1:"+strconv.Itoa(tryPort))
4443
if err == nil {
45-
ln.Close()
46-
// but then, we want to listen to as many local IP's as possible
47-
ln, err = net.Listen("tcp", ":"+strconv.Itoa(tryPort))
48-
if err == nil {
49-
break
50-
}
44+
break
5145
}
5246
if port > 0 {
5347
return nil, 0, errors.Wrapf(err, "unable to listen on port %d", port)

0 commit comments

Comments
 (0)
0