mirror of
https://github.com/apache/maven-mvnd.git
synced 2025-09-24 13:15:06 +00:00
Use a loopback address instead of 0.0.0.0
This commit is contained in:
@@ -17,6 +17,7 @@ package org.jboss.fuse.mvnd.client;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.net.InetAddress;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.net.Socket;
|
||||
import java.nio.channels.SocketChannel;
|
||||
@@ -362,7 +363,7 @@ public class DaemonConnector {
|
||||
}
|
||||
|
||||
public DaemonConnection<Message> connect(int port) throws DaemonException.ConnectException {
|
||||
InetSocketAddress address = new InetSocketAddress(port);
|
||||
InetSocketAddress address = new InetSocketAddress(InetAddress.getLoopbackAddress(), port);
|
||||
try {
|
||||
LOGGER.debug("Trying to connect to address {}.", address);
|
||||
SocketChannel socketChannel = SocketChannel.open();
|
||||
|
@@ -18,6 +18,7 @@ package org.jboss.fuse.mvnd.daemon;
|
||||
import java.io.IOException;
|
||||
import java.io.StringWriter;
|
||||
import java.lang.reflect.Field;
|
||||
import java.net.InetAddress;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.nio.channels.ServerSocketChannel;
|
||||
import java.nio.channels.SocketChannel;
|
||||
@@ -93,7 +94,7 @@ public class Server implements AutoCloseable, Runnable {
|
||||
cli = new DaemonMavenCli();
|
||||
|
||||
registry = new DaemonRegistry(layout.registry());
|
||||
socket = ServerSocketChannel.open().bind(new InetSocketAddress(0));
|
||||
socket = ServerSocketChannel.open().bind(new InetSocketAddress(InetAddress.getLoopbackAddress(), 0));
|
||||
|
||||
final int idleTimeout = Environment.DAEMON_IDLE_TIMEOUT
|
||||
.systemProperty()
|
||||
|
Reference in New Issue
Block a user