everywall / ladder

Selfhosted alternative to 12ft.io. and 1ft.io bypass paywalls with a proxy ladder and remove CORS headers from any URL
GNU General Public License v3.0
4.29k stars 169 forks source link

Add random IP generation for bots #55

Closed dxbednarczyk closed 7 months ago

dxbednarczyk commented 7 months ago

Also fixed a typo in main.go. Works with every IP (whether v4 or v6) in the Googlebot pool

To elaborate on the comments I included if anyone in the future sees this (and so I understand it better): 11111111 11111111 11111111 11110000 is the mask of a IPv4 CIDR block of /28, meaning it is in total 32 bits long and has 4 empty bits. emptyBits ** 2 is the amount of IPs in that block. So if we had 34.100.182.96/28, our range is 34.100.182.[96-111]. The same premise works for IPv6 addresses, the mask just increases to a size of 64 bits.

deoxykev commented 7 months ago

Sweet, thanks for adding the test too.