Is there a way to specify certain ip's to circumvent basic htaccess authentication?

I'm wanting it so that if someone from the internet accesses my site, they have to enter a password, but if i access it from localhost, it doesn't.