Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- I am facing an issue with getsockname API of socket module. Following is the code I am using to get the ipv6 address of remote system.
- import socket
- def checkit():
- s = socket.socket(socket.AF_INET6, socket.SOCK_DGRAM)
- s.connect(('10.10.10.10', 80))
- print "ipv6 addressn%s" % str(s.getsockname()[0])
- checkit()
- in Python 2.7.3
- ipv6 address
- 2001:420:404a:2018:155d:30ea:c897:76e9
- in Python 2.7.11
- ipv6 address
- ::1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement