This can be done with a proxy, e.g. naxsi if we can define the username in the header/cookie. IP is straightforward.