Check for SERVER_ADDR in dx_is_localhost function

Check for SERVER_NAME and SERVER_ADDR in dx_is_localhost function