$domain = $key.(preg_match('/\.(cn|com|org|net|cc)$/i',$key)?'':strstr($domain,'.')); // 生成对应子域名
修改为 list($key,$port) = explode(':',$key);
$domain = $key.(preg_match('/\.(cn|com|org|net|cc)$/i',$key)?'':strstr($domain,'.')).($port?':'.$port:''); // 生成对应子域名,兼容带端口号的子域名