Skip to content

Commit

Permalink
fix: don't bind all ips (#201)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
sileht authored Jan 12, 2023
1 parent 737183c commit 3ffda7f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pytest_rerunfailures.py
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ def _sock_send(self, conn, msg: str):
class ServerStatusDB(SocketDB):
def __init__(self):
super().__init__()
self.sock.bind(("", 0))
self.sock.bind(("localhost", 0))
self.sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)

self.rerunfailures_db = {}
Expand Down

0 comments on commit 3ffda7f

Please sign in to comment.