Skip to content

Commit c77a4b2

Browse files
committed
Add support for secure connections in ComfyWorkflowRunner
1 parent 8303424 commit c77a4b2

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

ci/run_workflows.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,13 @@
2020

2121

2222
class ComfyWorkflowRunner:
23-
def __init__(self, host: str, port: int, connect_timeout: int, workflow_timeout: int) -> None:
23+
def __init__(self, host: str, port: int, connect_timeout: int, workflow_timeout: int, secure: bool = False) -> None:
2424
self.host = host
2525
self.port = port
26-
self.base_http = f"http://{host}:{port}"
27-
self.base_ws = f"ws://{host}:{port}/ws"
26+
protocol_http = "https" if secure else "http"
27+
protocol_ws = "wss" if secure else "ws"
28+
self.base_http = f"{protocol_http}://{host}:{port}"
29+
self.base_ws = f"{protocol_ws}://{host}:{port}/ws"
2830
self.connect_timeout = connect_timeout
2931
self.workflow_timeout = workflow_timeout
3032
self.client_id = str(uuid.uuid4())
@@ -179,6 +181,7 @@ def parse_args() -> argparse.Namespace:
179181
parser.add_argument("--connect-timeout", type=int, default=DEFAULT_CONNECT_TIMEOUT, help="Seconds to wait for the server to come online")
180182
parser.add_argument("--workflow-timeout", type=int, default=DEFAULT_WORKFLOW_TIMEOUT, help="Seconds to wait for each workflow to finish")
181183
parser.add_argument("--fail-fast", action="store_true", help="Stop on first workflow failure")
184+
parser.add_argument("--secure", action="store_true", help="Use secure HTTPS/WSS connections (default: insecure for localhost)")
182185
return parser.parse_args()
183186

184187

@@ -189,6 +192,7 @@ def main() -> int:
189192
port=args.port,
190193
connect_timeout=args.connect_timeout,
191194
workflow_timeout=args.workflow_timeout,
195+
secure=args.secure,
192196
)
193197
success = runner.run_suite(args.workflows, fail_fast=args.fail_fast)
194198
return 0 if success else 1

0 commit comments

Comments
 (0)