Zend certified PHP/Magento developer

Routing all traffic to local socket server to act as a tunnel

I have developed a socket server in Python that runs on my Windows 11 device and another one on my cloud server. My goal is to tunnel all the traffic from my device to the cloud server through these socket servers. This is not a programming issue, as I have already implemented the socket servers.

My challenge is: I need to configure my device to route the traffic from the Ethernet interface to the local socket server, and then from the local socket server to the cloud server. (On the cloud server, I will forward the traffic to the eth0 interface and send back the response to the local socket server). I have created a Loopback adapter on my Windows device, but I am not sure how to set it up or redirect the packets to the socket server without affecting the internet connection of the device.

I have been searching the internet for about two weeks and asking many questions to AIs, but I have not found any answer or guidance. If you do not have a direct solution, please suggest some topics or keywords that I should look for to learn more. I am new to networking. Thank you!

enter image description here