Live data from Hacker News

I made a simple geolocation service

maxkostinevich.com

161–170 of 187 posts

Re: I made a simple geolocation service

#161

Earlier quoted context omitted.

I almost never do frontend work. I'll gladly take a PR if you want to make that one page faster and prettier. Though I don't want to make the build require yarn or other js/css compiler framework for a single page.

if you give me a github repo, ill see what I can do

Sure! https://github.com/georgyo/ifconfig.io/blob/master/templates...

Re: I made a simple geolocation service

#162

I built a simple API using pure NGINX to get the IP address of a client, for times when I needed to ask a customer for his IP address; it was easier sending them a URL for a service I control, than explaining how they could get that information another way. Now I have been thinking about opening it up for more people because while there are a variety of these services out there, one more does not hurt — it already ex…

I have exactly one non-shady use case: I work with an event org with a fairly common name, and another city in our region has an event with the same name. For some years, we’ve outranked them for major keywords and getting their confused customers was becoming a headache for us. So now if our website thinks you’re in the other city, a little banner appears above the content asking if you’re looking for the other site…

While I agree that your use-case is not shady, I am not sure how I would work that in the marketing material for the website — maybe I just suck at writing marketing copy.

But in any case, your response does tell me that there are other things that can be done with that information, so maybe I should focus on the IP thing, and have the geolocation features kinda hidden away in the documentation pages.

Re: I made a simple geolocation service

#163

I built a simple API using pure NGINX to get the IP address of a client, for times when I needed to ask a customer for his IP address; it was easier sending them a URL for a service I control, than explaining how they could get that information another way. Now I have been thinking about opening it up for more people because while there are a variety of these services out there, one more does not hurt — it already ex…

>is there any use-case for geolocation APIs that does not involve tracking users for shitty purposes? Use my GEOIP and longitude and adapt your CSS to show me your content in nightmode when it is night time in my Longitude. That would be cool.

Seems like the kind of thing I should not decide for an user.

When I build websites, I usually prefer using `prefers-color-scheme: dark` in CSS, so the user can decide.

Re: I made a simple geolocation service

#164
post #122

I applaud your efforts but it's disingenuous to title this how you "made a geolocation service" when you are just reading a field in someone else's geolocation service.

plus clickbaity title in disguise. writing 2req/sec would show that it's slower than my fridge.

My fridge can only handle a single request at any given time.

Re: I made a simple geolocation service

#165

I built a simple API using pure NGINX to get the IP address of a client, for times when I needed to ask a customer for his IP address; it was easier sending them a URL for a service I control, than explaining how they could get that information another way. Now I have been thinking about opening it up for more people because while there are a variety of these services out there, one more does not hurt — it already ex…

Geolocation is a solid first order solution to comply with local data privacy laws.

Re: I made a simple geolocation service

#166
post #98

I applaud your efforts but it's disingenuous to title this how you "made a geolocation service" when you are just reading a field in someone else's geolocation service.

Indeed. Using another service and being a wrapper around it is not all that impressive. He is also using workers which makes his solution expensive. I run ifconfig.io which now gets just over a billion hits a day. It is basically an echo service, and it just parrots back what cloudflare tells it. But since I run it on linode, it costs me a whopping $40 dollars a month for 35 billion returns a month. Using workers wou…

Exactly!. I was about to tell a similar story but yours is MUCH better. I run an internal service that just loads (a filtered version of) the maxmind geolite2 db in memory using it's great C library bindings for perl and on top of that I fork (so memory is shared) a mojo server and it's able to serve millons of reqs per hour on a very small vm. Response time is not much more than a "hello world"...

Re: I made a simple geolocation service

#167
post #86

Earlier quoted context omitted.

Yeah, that's coming from these four Fastly VCL variables: conn_speed: https://developer.fastly.com/reference/vcl/variables/geoloca... conn_type: https://developer.fastly.com/reference/vcl/variables/geoloca... proxy_desc: https://developer.fastly.com/reference/vcl/variables/geoloca... proxy_type: https://developer.fastly.com/reference/vcl/variables/geoloca... conn_type is interesting to me, I'm not sure how you would…

There is a good chance it's just https://dev.maxmind.com/geoip/geoip2/geoip2-connection-type-...

it used to be, for years, thats the older stuffin the "geoip." namespace.

the stuff in the "client.geo." space is from a newer/better/higher-tier service (they say, i forget the name). also I think some of it is mixed in with other sources and some of the info is self-sourced.

Re: I made a simple geolocation service

#168
post #136

Full marks to Cloudflare for engineering a radically effective and simple alternative to AWS Lambda (+API Gateway): It is simply a fantastic Serverless offering for low-latency network-bound workloads. For paying customers, they even thrown in freemium access to their globally distributed KV store and a forever-free Zonal Cache to sweeten the already good enough deal. That said, good luck with their Support team in c…

> now need to plan to add mitigation in scenarios where Workers blacks-out our traffic (but Support can't be of immediate help because "free customer"). How is it that you prefer to engineer those workarounds instead of just paying $20/month? It surely can't be worth in engineering hours and ongoing maintenance of hacky workaround code?

> How is it that you prefer to engineer those workarounds instead of just paying $20/month?

If it isn't clear, there's an issue of trust here, not money. And frankly, a fallback shouldn't be much of an issue since fly.io, AWS Lambda@Edge are like-for-like swaps, so we'd still be "serverless" just on a different yet similar platform (albeit costlier).

Re: I made a simple geolocation service

#169
post #98

I applaud your efforts but it's disingenuous to title this how you "made a geolocation service" when you are just reading a field in someone else's geolocation service.

Indeed. Using another service and being a wrapper around it is not all that impressive. He is also using workers which makes his solution expensive. I run ifconfig.io which now gets just over a billion hits a day. It is basically an echo service, and it just parrots back what cloudflare tells it. But since I run it on linode, it costs me a whopping $40 dollars a month for 35 billion returns a month. Using workers wou…

Hey I use ifconfig.io all the time! Thanks for the handy service. Really cool that you are able to handle that much traffic for so little $.

Re: I made a simple geolocation service

#170
One of the main challenges of building on Serverless platforms is rate-limiting.

There's nothing stopping a script-kiddie from thundering away at the Serverless endpoint resulting in an unexpected and quite high billables [0].

As for Workers specifically, Cloudflare's rate-limiting plan makes the whole thing 10x expensive at $10 for 2,000,000 good-requests [1] + $1 for 2,000,000 Workers requests. Other cloud providers I don't think fare any different.

[0] https://community.cloudflare.com/t/how-to-protect-cloudflare...

[1] https://support.cloudflare.com/hc/en-us/articles/11500027224...

Post reply on HN