Selecting "Run on Remote" will have to generate a URL for the remote client to connect to. There is no guarantee the sketch will have been saved yet, so a new URL might be best.
Navigating to the URL will load a preview of the sketch. Re-pressing "Run" on the "server" must reload the page on the client
Console output should be sent from the client to the "server".
The server should be able to send commands to the client, which are evaluated and the results returned.
This behaviour is similar to that when debugging in the same session, albeit with a network transport rather than postMessage or such like (to pass console output to the console tab).
SocketIO seems great for this; with our own wrapper to use SocketIO when remote, or postMessage when in normal operation. Points to remember; buffering console logging on the client (in the case of logging in a (infinite) loop). Circular references in a object being logged.
Some ideas;
postMessage
or such like (to pass console output to the console tab).SocketIO seems great for this; with our own wrapper to use SocketIO when remote, or
postMessage
when in normal operation. Points to remember; buffering console logging on the client (in the case of logging in a (infinite) loop). Circular references in a object being logged.