[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: https://github.com/vllm-project/vllm/commit/2918c1b49c88c29783c86f78d2c4221cb9622379 --------- Signed-off-by: liziyu <liziyu16@huawei.com>
This commit is contained in:
1 parent
a30261f779
commit
e98543267a
3 files changed
+15
-15
No files matched your search
@@ -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