DNS Load Balancer set Client Public IP
DNS request groop-myipAABBCCDDRRRR.islonline.net will evaluate best server based on IP encoded in AABBCCDD. A, B, C, D are bytes of IP. How it is done in C implementation below. R is a random number - just to force request to pop up to ISL servers.
std::string hefa::expand_star(std::string name, std::string orig_target) { std::string ret; for(std::string XSTD_EACH(ch, name)) { if(*ch == '*') { int rnd = 7; if (!orig_target.empty()) { try { std::string myip = my_saved_ip(orig_target); if(hefa::is_ip(myip)) { ret += "myip"; { tIAddr addr = hefa::get_iaddr(myip); char buf[8]; for(char *ptr = buf+sizeof(buf)-1; ptr >= buf; --ptr) { *ptr = char('a' + (addr & 0xf)); addr >>= 4; } ret.append(buf, sizeof(buf)); } rnd = 4; } } catch(...) {} } for(int i=0; i<rnd; ++i) ret += char('a' + (hefa::rand() % ('z'-'a'+1))); } else { ret += *ch; } } return ret; } std::string hefa::my_saved_ip(std::string orig_target) { return xstd::get_config_string_ex(xstd::User, "AutoTransport/Last public IP/" + boost_transport_tgt(orig_target)); }