   Geolocation library
  Is anybody aware of a (preferably free and open-source) library for IP geolocation ? One that works under a variety of OSes (Linux + Windows at least) ?Y.   
  I found this: http://iplocationtools.com I noticed a lot of people are using it. Look at the IP location API.This stuff is pretty cool.   ;  Thanks, but they don't seem to have a real library I can link my application with. Their online service limits to 3 requests/second maximum, and since I'd use it in a login procedure for users, there can be an unlimited amount of users trying to connect at the same time.I'm planning to use it to optimize the selection of servers for automatically downloading patches.Y.   ;  I ran across this offering a while ago: http://www.ipligence.com/en/products/. It isn't free (though fairly cheap), and isn't a library. On the plus side, it is the only such offering I know about [wink]WIPmania also looks pretty good.   ;Quote:Original post by YsaneyaThanks, but they don't seem to have a real library I can link my application with. Their online service limits to 3 requests/second maximum, and since I'd use it in a login procedure for users, there can be an unlimited amount of users trying to connect at the same time.Oh you wanted to do this server-side. If you did it client-side then you wouldn't need to worry. Oh well it says if you plan to use more than 3 then ask to be added to the white-list. Finding something like this for free is going to be hard.   ;Quote:Original post by YsaneyaThanks, but they don't seem to have a real library I can link my application with. Their online service limits to 3 requests/second maximum, and since I'd use it in a login procedure for users, Quote:Finding something like this for free is going to be hardYou could click IP Database link and  and do the lookup locally.[Edited by - Antheus on June 1, 2009 7:15:41 AM];  A quick sweep through Portage reveals http://www.maxmind.com/app/api (GPL-2) with a load of bindings for a large selection of languages.   ;Quote:Original post by AntheusQuote:Finding something like this for free is going to be hardYou could click IP Database link and  and do the lookup locally.Just link to iplocationtools. You accidently linked to a spam site.;Quote:Original post by SirisianJust link to iplocationtools. You accidently linked to a spam site.My bad, I was testing the service via proxy.   ;Quote:there can be an unlimited amount of users trying to connect at the same timeIf you have a number of servers, then you're running a commercial service. If the selection of the "right" server actually matters to you, then it's worth money. If you're not willing to pay the money, then the feature is probably not that important to you.Given that internet weather may vary by the hour, another approach might be for the client to simply ping each of the available patch servers (using a TCP-based message echo, say), and pick the one with the lowest latency. In general, for TCP bulk transfer on the internet, lower latency means better connectivity. This would have the nice effect of balancing load, too -- if a server is heavily loaded, TCP ping times will go up, and other servers will be selected.However, again, if you're doing this for real, I'd suggest going with one of the many fine Content Delivery Networks out there. Akamai and Amazon S3 are some of the giants, but there are others, too. They already solved all this for you, and you just connect to the address they give you, and the data gets to the user quickly. Good CDNs have deals with specific ISPs, so that the content actually moves out towards the edge of the network, even.