python - figuring out how to get all of the public ips of a machine -
i running code on multiple vpses (with more 1 ip, set aliases network interfaces) , trying figure out way such code acquires ip addresses network interfaces on fly , bind it. ideas on how in python without adding 3rd party library ?
edit know socket.gethostbyaddr(socket.gethostname())
, 3rd party package netifaces
, looking more elegant standard library ... , parsing output of ifconfig
command not elegant :)
the ip addresses assigned vpses, no possibility change them on fly.
you have open ssh tunnel or install proxy on vpses.
i think ssh tunnel best way how it, , use socks5 proxy python.
Comments
Post a Comment