One of the main things that ComfyUI has is websocket. That’s a way to get an image, through websocket it reports the workflow. A lot of important features are built around that.
And so I made my own server that I SSHed the port to. So I have a server on the internet that I can access like a normal ComfyUI. Of course, since it’s on the Internet, it needs to be protected. I have created a simple HTTP authentication. This is the authentication that asks for a user and password when you try to access the site. Everything is encrypted of course, certificates are configured.
So here we go. I can connect through other WebSocket libraries that support basic authentication (basically it’s just an extra header in the http request), but VL.IO.WebSocket is based on WatsonWebsocket, which doesn’t seem to support http authentication.
So that’s the story. It will be interesting to hear your opinion and how to work around it. Right now I’m thinking of forking WatsonWebsocket and doing a PR to implement this in an existing node. But I’ve tried a couple of WebSocket variants and managed to make a connection, although so far I’m having trouble getting data.
I finished posting on the forum and realised that I was able to get it up and running and everything was working with WebSocketSharp. I still don’t understand why it doesn’t work very consistently, but I’m sure I’ll find out.
But it would be cool to consider modifying WatsonWebsocket or maybe creating another extension based on WebSocketSharp.
upd: Contrary to my expectations, there is a bug in this package that causes it to work only sometimes, but most of the time it doesn’t work. I’ll release a working version with a different approach later.
looks to me like this is simply not exposed yet. WatsonWsClient comes with ConfigureOptions(). if you reference the GAC assembly System.Network.Websockets.Client, you can configure those options using SetRequestHeader(). would this do for your case?
To be honest, I don’t quite understand.
Does WatsonWebsocket have an option where CustomHeader can be attached? I’ve looked at the source a bit and couldn’t find out if this is possible. If it is, that would be great!
yes, that’s what i described in my reply above with: “WatsonWsClient comes with ConfigureOptions(). if you reference the GAC assembly System.Network.Websockets.Client, you can configure those options using SetRequestHeader()”
If it is possible to provide such functionality in a public API, I can test it in my setup to make sure it works. It’s a very necessary feature. Because without basic authentication protection, Websocket can be of limited use.
I wasn’t able to test this, but VL.IO.WebSocket 0.8.1 adds an input “Request Headers” to the WebsocketClient that you can provide with a Sequence<KeyValuePair<String,String>>. hope that helps.