Skip to content

Commit

Permalink
Only bind mock server on localhost
Browse files Browse the repository at this point in the history
Some application firewall (the one of MacOS at least) will show a notification
when an application bind on all address. Using localhost for binding avoid
this notification.
  • Loading branch information
PierreF committed Dec 25, 2023
1 parent b7cc900 commit 33dd190
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/paho_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def bind_to_any_free_port(sock) -> int:
"""
while True:
try:
sock.bind(('', 0))
sock.bind(('localhost', 0))
return sock.getsockname()[1]
except OSError:
pass
Expand Down

0 comments on commit 33dd190

Please sign in to comment.