How to use Xterm.js to connect to a container

I mean I dunno what your trying todo but I assume its executing commands on lots of containers, I built this the other weekend and may even more appropriate to either give some input on or a base for your research (it uses PHP and the exec API (but not xterm.js - its not needed) which i prefer to node everday)

Id be happy to give more specific guidance than look at my code but I dont know what your trying todo you’ll need to get more specific