Hi,
#1 Browsers run javascript only once per sec while page is in background or minimized. I don't know if Construct 2 or browsers support handling of these events. If not, you may try detect them by measuring time between calls. After going to bg detected, you may send notification to other players or leave the room.
#2 Most likely exported binary does not contain WebSocket object required for plugin. Several different websocket modules available for nodejs but they do not expose WebSocket objects in global namespace like browsers do. Probably some sort of adapter required. It's not clear currently how to integrate nodejs, websocket and Construct 2 plugin.