@Override
	public String runMacro(HTTPRequest httpReq, String parm, HTTPResponse httpResp)
	{
		final java.util.Map<String,String> parms=parseParms(parm);
		if(parms.containsKey("CURRENT"))
			return Integer.toString(httpReq.getClientPort());
		if(Thread.currentThread() instanceof CWThread)
		{
			final CWConfig config=((CWThread)Thread.currentThread()).getConfig();
			return CMParms.toListString(config.getHttpListenPorts());
		}
		if(httpReq.getClientPort()==0)
		{
			String serverType = parms.containsKey("ADMIN") ? "ADMIN" : "PUB";
			for(MudHost host : CMLib.hosts())
			{
				try
				{
					String var = host.executeCommand("WEBSERVER "+serverType+" PORT");
					if(var.length()>0)
						return var;
				}
				catch (Exception e)
				{
				}
			}
		}
		return Integer.toString(httpReq.getClientPort());
	}