mirror of https://github.com/vllm-project/vllm
`get_ip()`: Fix ipv4 ipv6 dualstack (#2408)
This commit is contained in:
parent
79d64c4954
commit
4b61c6b669
|
@ -58,7 +58,9 @@ def in_wsl() -> bool:
|
|||
|
||||
|
||||
def get_ip() -> str:
|
||||
return socket.gethostbyname(socket.gethostname())
|
||||
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
||||
s.connect(("8.8.8.8", 80)) # Doesn't need to be reachable
|
||||
return s.getsockname()[0]
|
||||
|
||||
|
||||
def get_open_port() -> int:
|
||||
|
|
Loading…
Reference in New Issue