I have an EC2 instance. I need to receive data from 4 separate websockets located in different regions around the world.
Three of the websockets are working fine, but one of the websockets is being routed in a weird way by their CDN and it's taking multiple seconds for the data to reach me. So I want to create my own proxy next to the source (I am only 80 milliseconds away from the region by ping) and connect to the websocket through the proxy so that I can get the data faster. I should save a few seconds by doing this.
So, I want to connect to 3 websockets normally, and to 1 websocket through my own proxy.
I'm using Java's
okhttp3 websocket library.
How would I achieve this?