@dc42:
Is there any reason why the Javascript code can't be run client side instead?
In theory, it could all be client side. For example, Chilipeppr works this way*. In practice, that would be a huge change to CNCjs.
As a "never before had a pull accepted", I feel it would be prudent to "go with the flow" for the moment, and add native Duet support to the way CNCjs is structured. After that, add a TCP/IP connection option.
And… there is always the Windows, Mac, and Linux stand-alone versions. No server is needed at all. With those in play, I'll say that "all browser side" is somewhere between third priority and no real need to do it at all.
.
.
Chilipeppr runs entirely in the browser, EXCEPT for a small program that provides the serial USB connection (browsers won't let Javascript control serial ports). Obviously, with a TCP/IP connection, this would be come moot.