ipv6

How to store a 128 bit number in a single column in MySQL?

谁说我不能喝 提交于 2019-12-18 10:40:06
问题 I'm changing some tables to store IP addresses as numbers rather than strings. This is simple with IPv4 where the 32 bit address can fit into an integer column. However, an IPv6 address is 128 bits. The MySQL documentation only shows numeric types up to 64 bits ("bigint"). Should I stick with char/varchar for IPv6? (Ideally I'd like to use the same column for IPv4 and IPv6, so I'd prefer not to do this). Is there anything better than using two bigint columns? I would prefer not to have to

Socket listener for IPv6 and IPv4

◇◆丶佛笑我妖孽 提交于 2019-12-18 08:25:44
问题 I ported an application to support IPv6, using popular tutorials. I decided to use only one socket listener for both protocols. Now I realized I have to set IPV6_V6ONLY properly (it's only working on my x86 linux out of the box, but not on my ARM). Is this really the way to go? Some say IPV6_V6ONLY shouldn't be used (apparently it's outdated, because of IPv4 mapping over the wire), some say using one socket for both protocols is fine. So, I'm confused. What is the current state about this

Node.js dns.resolve() vs dns.lookup()

ⅰ亾dé卋堺 提交于 2019-12-18 07:37:25
问题 I need to lookup a given host to its corresponding IP in Node.js. There seems to be two native methods of doing this: > dns.resolve('google.com', (error, addresses) => { console.error(error); console.log(addresses); }); QueryReqWrap { bindingName: 'queryA', callback: { [Function: asyncCallback] immediately: true }, hostname: 'google.com', oncomplete: [Function: onresolve], domain: Domain { domain: null, _events: { error: [Function] }, _eventsCount: 1, _maxListeners: undefined, members: [] } }

Porting getifaddrs to Win XP

末鹿安然 提交于 2019-12-18 05:56:21
问题 I'm trying to port a MacOSX app to windows and I've come up against a problem around getifaddrs. Basically windows does not support it. I'm trying to figure a way to re-implement it (for AF_INET and AF_INET6) but the "equivalent" functionality on windows appears to be nothing like the MacOSX support. Has someone done this sort of conversion before? If so is there a nice way I can get windows to report me interface info like MacOSX does? 回答1: The closest functions on Windows are

How to convert ipv4 address to ipv6 use AFNetworking?

亡梦爱人 提交于 2019-12-18 05:25:44
问题 I've a problem with IPV6 . Apple reject my app with error: We discovered one or more bugs in your app when reviewed on iPad and iPhone running iOS 10.0.2 on Wi-Fi connected to an IPv6 network. Specifically, your app stayed static at the launch screen and there was no further content loaded. We've attached screenshot(s) for your reference. But my sever is not supporting IPV6 . I use library AFNetworking to connect server. Please help me some solution? Thank you for any support! 回答1: I got this

how to force python httplib library to use only A requests

大城市里の小女人 提交于 2019-12-18 05:16:14
问题 The problem is that urllib using httplib is querying for AAAA records. I would like to avoid that. Is there a nice way to do that? >>> import socket >>> socket.gethostbyname('www.python.org') '82.94.164.162' 21:52:37.302028 IP 192.168.0.9.44992 > 192.168.0.1.53: 27463+ A? www.python.org. (32) 21:52:37.312031 IP 192.168.0.1.53 > 192.168.0.9.44992: 27463 1/0/0 A 82.94.164.162 (48) python /usr/lib/python2.6/urllib.py -t http://www.python.org >/dev/null 2>&1 21:53:44.118314 IP 192.168.0.9.40669 >

How to support both IPv4 & IPv6 on Java

╄→гoц情女王★ 提交于 2019-12-18 03:12:52
问题 One of our Java program when started, it only listen on IPv6 (8080) e.g. # netstat -ntpl Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN - tcp6 0 0 :::8080 :::* LISTEN - tcp6 0 0 :::22 :::* LISTEN - The problem is it is not accessible from outside (except localhost), to solve this, I have this manually add -Djava.net.preferIPv4Stack=true But this make the program is only for IPv4 network. Is it possible to do something like the sshd

How to support both IPv4 & IPv6 on Java

允我心安 提交于 2019-12-18 03:11:38
问题 One of our Java program when started, it only listen on IPv6 (8080) e.g. # netstat -ntpl Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN - tcp6 0 0 :::8080 :::* LISTEN - tcp6 0 0 :::22 :::* LISTEN - The problem is it is not accessible from outside (except localhost), to solve this, I have this manually add -Djava.net.preferIPv4Stack=true But this make the program is only for IPv4 network. Is it possible to do something like the sshd

Force python mechanize/urllib2 to only use A requests?

女生的网名这么多〃 提交于 2019-12-17 22:42:39
问题 Here is a related question but I could not figure out how to apply the answer to mechanize/urllib2: how to force python httplib library to use only A requests Basically, given this simple code: #!/usr/bin/python import urllib2 print urllib2.urlopen('http://python.org/').read(100) This results in wireshark saying the following: 0.000000 10.102.0.79 -> 8.8.8.8 DNS Standard query A python.org 0.000023 10.102.0.79 -> 8.8.8.8 DNS Standard query AAAA python.org 0.005369 8.8.8.8 -> 10.102.0.79 DNS

Quick way of expanding IPv6 Addresses with PHP

两盒软妹~` 提交于 2019-12-17 19:02:37
问题 I was working on a project where I needed to expand IPv6 addresses. There are not many functions out there created by other users, and the ones that exist are ugly. Some of them included multiple foreach 's and gmp_init , which added a lot of overhead and harder to maintain code. I need a simple, non-taxing script to expand IPv6. Posting this for the community. 回答1: The following is a two liner, where $ip is a condensed IPv6 address. Returns expanded $ip . Example : $ip = "fe80:01::af0"; echo