Skip to content

Commit

Permalink
Merge pull request #13 from rafa-be/remove_security_warning_on_listen…
Browse files Browse the repository at this point in the history
…_on_all
  • Loading branch information
sharpener6 authored Sep 12, 2024
2 parents ab46c16 + f439443 commit bfe257b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion parfun/about.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "6.0.7"
__version__ = "6.0.8"
4 changes: 2 additions & 2 deletions parfun/backend/utility.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import socket


def get_available_tcp_port() -> int:
def get_available_tcp_port(hostname: str = "127.0.0.1") -> int:
with socket.socket(socket.AddressFamily.AF_INET, socket.SocketKind.SOCK_STREAM) as sock:
sock.bind(("0.0.0.0", 0))
sock.bind((hostname, 0))
return sock.getsockname()[1]

0 comments on commit bfe257b

Please sign in to comment.