comfy-ui-client icon indicating copy to clipboard operation
comfy-ui-client copied to clipboard

ComfyUIClient websocket error when using https url

Open PsilAxis opened this issue 7 months ago • 0 comments

when using a free ngrok url to test my application, i kept getting the following errors.

{"level":30,"time":1720141565995,"pid":23720,"hostname":"DESKTOP","msg":"Connecting to url: ws://bc07-[public-ip].ngrok-free.app/ws?clientId=baadbabe-b00b-4206-9420-deadd00d1337"} 
{"level":50,"time":1720141566178,"pid":23720,"hostname":"DESKTOP","err":{"type":"Error","message":"Unexpected server response: 307","stack":"Error: Unexpected server response: 307\n at ClientRequest.<anony mous> 

i was able to fix this with a workaround by going into .\node_modules\comfy-ui-client\dist\index.js from inside my project and changing

const url = `ws://${this.serverAddress}/ws?clientId=${this.clientId}`; into const url = `wss://${this.serverAddress}/ws?clientId=${this.clientId}`;

but i dont think that editing the module itself from my project is a good solution, even though it worked for me this time.

PsilAxis avatar Jul 05 '24 02:07 PsilAxis