fix: comfyui tool supports https (#11823)

This commit is contained in:
傻笑zz 2024-12-19 23:05:27 +08:00 committed by GitHub
parent de3911e930
commit 1548501050
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -11,7 +11,10 @@ class ComfyUIProvider(BuiltinToolProviderController):
def _validate_credentials(self, credentials: dict[str, Any]) -> None:
ws = websocket.WebSocket()
base_url = URL(credentials.get("base_url"))
ws_address = f"ws://{base_url.authority}/ws?clientId=test123"
ws_protocol = "ws"
if base_url.scheme == "https":
ws_protocol = "wss"
ws_address = f"{ws_protocol}://{base_url.authority}/ws?clientId=test123"
try:
ws.connect(ws_address)