websocket_json: add support for 'resource' and robust handling of IODev