It works!  I built out the beginnings of the function to return the appropriate IP address, but right now it just gives the same IP for everything.