Using code from https://github.com/flyme2bluemoon/InfiniteFlightConnect-Python,
import socket
udp = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
udp.bind(("", 15000))
while True:
data, addr = udp.recvfrom(4096)
if data:
break
udp.close()
IP = addr[0]
PORT = 10112
ADDR = (IP, PORT)
tcp = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
tcp.connect(ADDR)
I am able to receive the UDP packet containing the correct connection information:
{"Addresses":[{CORRECT PHONE IP ADDRESSES}],"Aircraft":"Unknown","DeviceID":"Google Pixel","DeviceName":"Pixel","Livery":"Unknown","Port":10111,"State":"MainMenu","Version":"21.4.0.1565"}
However, attempting to connect via TCP (with the given address and port 10112 (for API v2)) results in
TimeoutError: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
Any help is appreciated!