00001 #include "headers.h"
00002
00003 ProxyParser::ProxyParser(CommandProcessor* cp) : CommandParser(cp)
00004 {}
00005
00006
00007 Command*
00008 ProxyParser::parse(string input) {
00009 stringstream s(input);
00010
00011
00012 s >> m_method;
00013
00014
00015 string hostUrl;
00016 s >> hostUrl;
00017
00018 Command* command;
00019
00020
00021 if (hostUrl.find("://") < hostUrl.length()) {
00022 if (hostUrl.substr(0, 7) == "http://") {
00023
00024 command = new ProxyRequestCommand();
00025 command->setArg(1, input);
00026 return command;
00027 }
00028 }
00029 return NULL;
00030 }