Access LXC container using VNC

How can I access lxc (LXD) conatiner via VNC client e.g NoVNC.
I know it doesnt work out of the box. Proxmox has done the implementation, but I am really interested to know how does it render the lxc console through websockets on master proxy.