What kind of "bots" are you referring to. Crawlers or scripted HTTP requests? If it's crawlers then you can just detect them by looking at the user agent. As for proxies, there are several ways to go about it but none of them will be foolproof. You can for example look at the port that the connection was established from. Also you can compare the IP address of the visitor with a database of known proxies, but that will of course not work if the user has a private proxy.