Skip to content

Commit 3ffda7f

Browse files
authored
fix: don't bind all ips (#201)
Binding all IPs is kind of Security issues and also very annoying when the OS has a firewall blocking application doing such thing or opening a popup to allow it (like the default MacOS or Windows firewall). The client uses "localhost", so the server can only bind the ip associated with the hostname "localhost". This will avoid opening this tools to anyone on the network and avoid having to configure windows or macos firewall to make pytest run.
1 parent 737183c commit 3ffda7f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

pytest_rerunfailures.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ def _sock_send(self, conn, msg: str):
440440
class ServerStatusDB(SocketDB):
441441
def __init__(self):
442442
super().__init__()
443-
self.sock.bind(("", 0))
443+
self.sock.bind(("localhost", 0))
444444
self.sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
445445

446446
self.rerunfailures_db = {}

0 commit comments

Comments
 (0)