Munzy / blackbox

A replacement for Black Box Proxy Block
20 stars 7 forks source link

Multiple IP addresses in one request #717

Closed artemmolotov closed 4 years ago

artemmolotov commented 4 years ago

Hi!

Are there plans to add support for specifying multiple IP addresses in a single request with any limit on the number of IPs (10/20/30/50)?

For example: https://blackbox.ipinfo.app/lookup/8.8.8.8,8.8.4.4


P.S.: Thank you for the API and its support. ๐Ÿš€

Munzy commented 4 years ago

How would we format the response though?

Y,N

You would also need to parse it with your application as well.

artemmolotov commented 4 years ago

I think that the Y,N is quite suitable for developers.

We can also consider the YN, which can be a little more convenient for character-by-character iteration (array_of_chars[index]), if YN doesn't cause problems that I donโ€™t see right now.

If you wish, you can wait some time for other people's ideas or implement at your discretion.

Munzy commented 4 years ago

The big issue with bulk queries that I see, is that it will break caching. So the lookups may take far longer than most of our normal responses.

YN is a nice option as well. How many queries would you normally throw into a single request and what is your use case for it?

artemmolotov commented 4 years ago

Yes, that really raises cache questions. However, if it is necessary to check several IPs, then the total time and processor resources for several requests may be higher than one request with several IPs. But I could be wrong. Cloudflare helps with the cache now.

How many queries would you normally throw into a single request?

Up to 32, but any possible number can increase productivity.

What is your use case for it?

There are amateur game servers for up to 32 (or less) people. Sometimes a player can start to bypass a lot of protection mechanisms and start cheating. The only option to block is by IP address.

During such grave violations, it is advisable to launch "additional protection" - reject players with the IP address of proxy servers during the game entry process. There is no problem with this, but from time to time a game map is changed immediately for all players with a server memory reset. Because of this, admin need to check everyone at about the same time. This can also be solved with some tricky caches. Previously, caches seemed problematic to me, but in the process of writing this comment, I came up with a good option.

P.S.: it seems that your API has already been used in such case (last comment in the #1).

Munzy commented 4 years ago

Yes, Cloudflare does all the caching and you shouldn't need to do it on your end.

I see your point on game servers, and I guess I'd be curious how you would wrap up that request when a bulk of players joined at once. Normally it is done as a separate interaction for each login as joins aren't always that timely.

I'd say it also depends on what platform you are coding on, as with curl and NodeJS you could do a bulk query against multiple endpoints all at once and still use the current API.

Munzy commented 4 years ago

https://blackbox.ipinfo.app/api/v1/8.8.8.8,192.168.1.1

N,Y

@artemmolotov

Munzy commented 4 years ago

Should note at the moment a max of 8 lookups is possible. I'll increase it later after I see how it affects performance.