When facing such connection issues I used ssh tunnel so each request goes via already established TCP connection.