Spaces:
Sleeping
Sleeping
Download src/fastmcp/utilities/http.py from purecipher/xsecuremcp: direct link, hf CLI and curl.
- Browser
- Download file 245 Bytes
-
https://huggingface.co/spaces/purecipher/xsecuremcp/resolve/main/src/fastmcp/utilities/http.py
- Command line
-
hf download hf://spaces/purecipher/xsecuremcp/src/fastmcp/utilities/http.py
-
curl -L -o http.py https://huggingface.co/spaces/purecipher/xsecuremcp/resolve/main/src/fastmcp/utilities/http.py
245 Bytes
| import socket | |
| def find_available_port() -> int: | |
| """Find an available port by letting the OS assign one.""" | |
| with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s: | |
| s.bind(("127.0.0.1", 0)) | |
| return s.getsockname()[1] | |