Update src/fastmcp/utilities/http.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Jeremiah Lowin 2025-05-31 20:34:14 -04:00 committed by GitHub
commit 9cc67eeb70
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -3,6 +3,6 @@ import socket
def find_available_port() -> int:
"""Find an available port by letting the OS assign one."""
with socket.socket() as s:
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
s.bind(("127.0.0.1", 0))
return s.getsockname()[1]