[bugfix] fix proxy hen host ip using domain name (#4243)
### What this PR does / why we need it?
fix proxy when host ip using domain name
- vLLM version: v0.11.0
- vLLM main:
2918c1b49c
---------
Signed-off-by: liziyu <liziyu16@huawei.com>
This commit is contained in:
@@ -116,13 +116,13 @@ class ServerState:
|
||||
def __init__(self, host, port):
|
||||
self.host = host
|
||||
self.port = port
|
||||
ip = ipaddress.ip_address(self.host)
|
||||
if isinstance(ip, ipaddress.IPv4Address):
|
||||
self.url = f'http://{host}:{port}/v1'
|
||||
elif isinstance(ip, ipaddress.IPv6Address):
|
||||
self.url = f'http://[{host}]:{port}/v1'
|
||||
else:
|
||||
raise RuntimeError(f"Invild host IP address {ip}")
|
||||
self.url = f'http://{host}:{port}/v1'
|
||||
try:
|
||||
ip = ipaddress.ip_address(self.host)
|
||||
if isinstance(ip, ipaddress.IPv6Address):
|
||||
self.url = f'http://[{host}]:{port}/v1'
|
||||
except Exception:
|
||||
pass
|
||||
self.client = httpx.AsyncClient(timeout=None,
|
||||
base_url=self.url,
|
||||
limits=httpx.Limits(
|
||||
|
||||
@@ -118,13 +118,13 @@ class ServerState:
|
||||
def __init__(self, host, port):
|
||||
self.host = host
|
||||
self.port = port
|
||||
ip = ipaddress.ip_address(self.host)
|
||||
if isinstance(ip, ipaddress.IPv4Address):
|
||||
self.url = f'http://{host}:{port}/v1'
|
||||
elif isinstance(ip, ipaddress.IPv6Address):
|
||||
self.url = f'http://[{host}]:{port}/v1'
|
||||
else:
|
||||
raise RuntimeError(f"Invild host IP address {ip}")
|
||||
self.url = f'http://{host}:{port}/v1'
|
||||
try:
|
||||
ip = ipaddress.ip_address(self.host)
|
||||
if isinstance(ip, ipaddress.IPv6Address):
|
||||
self.url = f'http://[{host}]:{port}/v1'
|
||||
except Exception:
|
||||
pass
|
||||
self.client = httpx.AsyncClient(timeout=None,
|
||||
base_url=self.url,
|
||||
limits=httpx.Limits(
|
||||
|
||||
@@ -13,7 +13,7 @@ def get_global_te(hostname: str, device_name: Optional[str]):
|
||||
ip = ipaddress.ip_address(hostname)
|
||||
if isinstance(ip, ipaddress.IPv6Address):
|
||||
raise RuntimeError(
|
||||
"The backend if mooncake's Ascend Direct Xfer Library currcenly dose not support IPv6."
|
||||
"The backend of mooncake's Ascend Direct Xfer Library currently does not support IPv6."
|
||||
)
|
||||
except ValueError:
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user