ipv4

Win32 sockets - Forcing ip packets to leave physical interfaces when sending to other local interfaces

血红的双手。 提交于 2019-12-19 03:42:11
问题 Summary: I'm trying to create sockets to pass data between two physical interfaces that exist on the same machine, and Win32 sockets always forwards the traffic directly in the kernel instead of pushing through the physical interfaces. Is there any way to disable this behavior, perhaps through device settings, registry tweaks, routing table shenanigans, or socket options? We're using Windows XP SP3. Some background. I'm attempting to build some completely automated IP tests to exercise our

How to test iOS app on supporting IPv6? Apple rejected app as it is not IPv6 compatible

跟風遠走 提交于 2019-12-18 11:50:46
问题 have apps, built 2015 and 2014. How can I test them for IPv6? If my apps doesn't support IPv6, what should I do? My apps are using AFNetworking and Alamofire. I'm connecting mostly to domains ( Ex. api.example.com/v1/...). Only 1 app use IP: (ex: 12.12.12.12:3000/api/v1/...). 回答1: This solution only works if you have an ethernet connection. For creating an iPV6 NAT64 wifi network, follow these steps Step 1 : Open system preferences Step 2 : Open Sharing Step 3 : Click on internet sharing Step

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 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 >

Testing if a network in cidr notation overlaps another network

最后都变了- 提交于 2019-12-17 19:23:05
问题 I'm searching for a php algorithm that efficiently test if one cidr notated network overlaps another. Basically I have the following situation: Array of cidr adresses: $cidrNetworks = array( '192.168.10.0/24', '10.10.0.30/20', etc. ); I have a method that adds networks to the array, but this method should throw an exception when a network is added that overlaps with a network allready in the array. So ie. if 192.168.10.0/25 is added an exception should be thrown. Does anyone have/know/"can

Get local network interface addresses using only proc?

给你一囗甜甜゛ 提交于 2019-12-17 15:40:03
问题 How can I obtain the (IPv4) addresses for all network interfaces using only proc? After some extensive investigation I've discovered the following: ifconfig makes use of SIOCGIFADDR , which requires open sockets and advance knowledge of all the interface names. It also isn't documented in any manual pages on Linux. proc contains /proc/net/dev , but this is a list of interface statistics. proc contains /proc/net/if_inet6 , which is exactly what I need but for IPv6. Generally interfaces are

IIS Request.UserHostAddress returning IPV6 (::1), even when IPV6 disabled

时间秒杀一切 提交于 2019-12-17 10:53:25
问题 In the properties section of my network card, on windows server 2008, i have IPV6 disabled, leaving only IPV4 enabled. However in ASP.NET, Request.UserHostAddress returns '::1', an IPV6 address. Has anyone got any idea how to revert back to IPV4? 回答1: If you're connecting to localhost (::1 / 127.0.0.1), you're not using the network card that your server has, but rather like a virtual card that windows has. I don't think there is anyway to configure the loopback card and removing IPv6 from it,

How can I convert IPV6 address to IPV4 address?

你离开我真会死。 提交于 2019-12-17 06:55:43
问题 I have application that uses IPv4 addresses (it stores them as long), so it only understands IPv4 addresses. Is it possible to convert IPv6 address to IPv4 with Java ? 回答1: While there are IPv6 equivalents for the IPv4 address range, you can't convert all IPv6 addresses to IPv4 - there are more IPv6 addresses than there are IPv4 addresses. The only sane way around this issue is to update your application to be able to understand and store IPv6 addresses. 回答2: The IPAddress Java library can