<div dir="ltr"><div dir="ltr">Hi<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Jan 8, 2021 at 12:07 AM Nick Couchman <<a href="mailto:vnick@apache.org">vnick@apache.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hey, everyone,<div>I'm a contributor to the Guacamole project, and am currently working on adding support for the SPICE protocol to Guacamole. If you haven't heard of Guacamole, it is a protocol and associated software components for making various remote desktop interfaces available via native HTML5 in browsers. I realize that there is already a spice-html5 client, but, for various reasons, we'd like to add the SPICE support to Guacamole, as well.</div><div><br></div><div>Within Guacamole, the clients for the individual protocols are implemented in a daemon - guacd - that is written in C. It accesses the various remote desktop protocols that we support (VNC, RDP, SSH, and Telnet, today) and does the translation to the Guacamole protocol. So, I am attempting to write the SPICE client for this using the spice-glib library.</div><div><br></div><div>I'm running into an issue with the code I've written thus far. I've followed API documentation and some code examples, and I have it to where I'm configuring all of the required pieces - hostname/IP, tls-port, password, etc. I've set up the handlers for the session (channel-event) and for the channels. When I attempt to connect, the SPICE client starts up, the session starts/connects, and I see the main channel get created, but the connection never progresses after that. As far as I can tell, it doesn't even try any sort of connection to the SPICE server - I don't see any network traffic going to the SPICE server, and it never progresses past that point. I'm not seeing any errors - nothing that indicates it's tried and failed, or is expecting additional input, or anything like that.</div><div><br></div><div>I'm happy to share code if anyone is interested in looking at what I've done so far, or if anyone has any generic hints as to what I might check or resources that are helpful in writing a C-based client for SPICE, I'd greatly appreciate the insight and help. I'm sure there's something reasonably simple that I'm not doing, or doing out of order, but I'm a bit stumped at the moment.</div></div></blockquote><div><br></div><div>Spice uses multiple connections which are called channels for the various streams. You need to get and listen for available channels on the SpiceSession.<br></div><div><br></div><div>Have you looked at some of the tools in spice-gtk source tree, for example spicy-screenshot.c ? <a href="https://gitlab.freedesktop.org/spice/spice-gtk/-/blob/master/tools/spicy-screenshot.c">https://gitlab.freedesktop.org/spice/spice-gtk/-/blob/master/tools/spicy-screenshot.c</a>, this should give you a simple way to get started. You will need to handle the SpiceDisplayChannel, SpiceCursorChannel and SpiceInputsChannel to have basic UI remoting iirc.</div><div><br></div><div>Hope that helps<br></div></div><br>-- <br><div dir="ltr" class="gmail_signature">Marc-André Lureau<br></div></div>