Processing: Getting data from a local web server created by NodeMCU v1.0

I saw this (https://maker.pro/arduino/tutorial/how-to-interface-arduino-and-the-mpu-6050-sensor) project and wanted to make some changes to it. I connected the MPU6050 to an Arduino Mega and used serial communication to transfer the required data to NodeMCU v1.0 which in turn creates a web server and uploads the data to it. The Processing code is supposed to get the data from the server instead of getting it from serial port as in the actual project. Is there a way to do it?

Processing_Code.pde (5.36 KB)

NodeMCU_Code.ino (2.36 KB)

Mega_Code.ino (3.91 KB)

Search for TCP connection, server, client, telnet