code: function fetchSnapshot(conn, params) {
  	// For Debug --------------------------------------------
  	//if(start_time === 0) {
  	//	start_time = Date.now();
  	//}
  	// ------------------------------------------------------
  	var device = devices[params.address];
  	if(!device) {
  		var res = {'id': 'fetchSnapshot', 'error': 'The specified device is not found: ' + params.address};
  		conn.send(JSON.stringify(res));
  		return;
  	}
  	device.fetchSnapshot((error, result) => {
  		var res = {'id': 'fetchSnapshot'};
  		if(error) {
  			res['error'] = error.toString();
  		} else {
  			var ct = result['headers']['content-type'];
  			var buffer = result['body'];
  			var b64 = buffer.toString('base64');
  			var uri = 'data:' + ct + ';base64,' + b64;
  			res['result'] = uri;
  
  			// For Debug --------------------------------------------
  			/*
  			total_size += parseInt(result['headers']['content-length'], 10);
  			var duration = Date.now() - start_time;
  			var bps = total_size * 1000 / duration;
  			var kbps = parseInt(bps / 1000);
  			total_frame ++;
  			var fps = Math.round(total_frame * 1000 / duration);
  			console.log(kbps + ' kbps / ' + fps + ' fps');
  			*/
  			// ------------------------------------------------------
  		}
  		conn.send(JSON.stringify(res));
  	});
  }
docs: For Debug -------------------------------------------- var total_size = 0; var start_time = 0; var total_frame = 0; ------------------------------------------------------