Index: /trunk/_win/cheroxy/cheroxy.vcproj
===================================================================
--- /trunk/_win/cheroxy/cheroxy.vcproj	(revision 27)
+++ /trunk/_win/cheroxy/cheroxy.vcproj	(revision 28)
@@ -178,4 +178,8 @@
 			</File>
 			<File
+				RelativePath="..\..\src\CRXFilter.cpp"
+				>
+			</File>
+			<File
 				RelativePath="..\..\src\CRXHttpMessage.cpp"
 				>
@@ -216,4 +220,8 @@
 			</File>
 			<File
+				RelativePath="..\..\include\CRXFilter.h"
+				>
+			</File>
+			<File
 				RelativePath="..\..\include\CRXHttpMessage.h"
 				>
Index: /trunk/include/CRXFilter.h
===================================================================
--- /trunk/include/CRXFilter.h	(revision 28)
+++ /trunk/include/CRXFilter.h	(revision 28)
@@ -0,0 +1,53 @@
+/**
+ * CRXFilter.h
+ */
+
+#ifndef __CRXFILTER_H__
+#define __CRXFILTER_H__
+
+#include "CRXHttpRequest.h"
+#include "CRXHttpResponse.h"
+
+#include <string>
+#include <list>
+
+#define FILTER_DELIMITER	'|'
+
+#define CRX_FILTER_MATCHED			true
+#define CRX_FILTER_NOT_MATCHED		false
+
+typedef enum
+{
+	CRX_FILTER_REQUEST_FILE_EXTENSION = 1
+} E_CRX_FILTER_REQUEST;
+
+class CRXFilter
+{
+private:
+	typedef struct __crx_filter__ {
+		E_CRX_FILTER_REQUEST	mFilterType;
+		bool					mIsMatched;
+		std::string				mValue;
+	} S_CRX_FILTER;
+
+	typedef std::list<S_CRX_FILTER>		CRXFilter_t;
+
+	CRXFilter_t		mRequestFilterList;
+	CRXFilter_t		mResponseFilterList;
+
+public:
+	CRXFilter	(void);
+	~CRXFilter	(void);
+
+public:
+	void		SetRequestFilter		(const E_CRX_FILTER_REQUEST	aType,
+										 const bool					aIsMatched,
+										 const std::string			aValue);
+
+	void		RemoveRequestFilter		(const E_CRX_FILTER_REQUEST	aType);
+
+	bool		CheckRequestFilter		(const E_CRX_FILTER_REQUEST	aType,
+										 const CRXHttpRequest		& aRequest);
+};
+
+#endif // #ifndef __CRXFILTER_H__
Index: /trunk/include/CRXHttpRequest.h
===================================================================
--- /trunk/include/CRXHttpRequest.h	(revision 27)
+++ /trunk/include/CRXHttpRequest.h	(revision 28)
@@ -12,4 +12,5 @@
 	std::string	mMethod;
 	std::string	mUrl;
+	std::string	mFileExtension;
 
 	std::string	mProtocol;
@@ -18,21 +19,23 @@
 
 public:
-	CRXHttpRequest					(void);
-	~CRXHttpRequest					(void);
+	CRXHttpRequest		(void);
+	~CRXHttpRequest		(void);
 
 private:
-	void				Parse		(void);
-	void				Reset		(void);
+	void				Parse				(void);
+	void				ParseFileExtension	(void);
+	void				Reset				(void);
 
 public:
-	void				SetHeader	(const char * aHttpRequest);
-	std::string			GetHeader	(void) const;
+	void				SetHeader			(const char * aHttpRequest);
+	std::string			GetHeader			(void) const;
 
-	CRXHttpRequest &	operator =	(const char * aHttpRequest);
+	CRXHttpRequest &	operator =			(const char * aHttpRequest);
 
 public:
-	std::string			GetURL		(void) const;
-	std::string			GetHost		(void) const;
-	int					GetPort		(void) const;
+	std::string			GetURL				(void) const;
+	std::string			GetHost				(void) const;
+	int					GetPort				(void) const;
+	std::string			GetFileExtension	(void) const;
 };
 
Index: /trunk/include/CRXProxy.h
===================================================================
--- /trunk/include/CRXProxy.h	(revision 27)
+++ /trunk/include/CRXProxy.h	(revision 28)
@@ -10,4 +10,5 @@
 #include "CRXHttpRequest.h"
 #include "CRXHttpResponse.h"
+#include "CRXFilter.h"
 
 #define ERROR_PROXY								-10000
@@ -17,15 +18,12 @@
 #define ERROR_PROXY_FAILED_TO_SEND_RESPONSE		ERROR_PROXY - 4
 #define ERROR_PROXY_FAILED_TO_CONNECT_TO_SERVER	ERROR_PROXY - 5
-#define ERROR_PROXY_FAILED_TO_SET_RESPONSE		ERROR_PROXY - 5
+#define ERROR_PROXY_FAILED_TO_SET_RESPONSE		ERROR_PROXY - 6
 
-typedef enum {
-	CRX_PROXY_STATUS_ERROR = -1,
-	CRX_PROXY_STATUS_IDLE,
-	CRX_PROXY_STATUS_BUSY
-} E_CRX_PROXY_STATUS;
 
 class CRXProxy : public CRXException
 {
 private:
+	bool				mIsIntercepted;
+
 	CRXSocket			mClient;
 	CRXSocket			mServer;
@@ -34,5 +32,5 @@
 	CRXHttpResponse		mHttpResponse;
 
-	E_CRX_PROXY_STATUS	mProxyStatus;
+	static CRXFilter	mFilter;
 
 public:
@@ -43,4 +41,5 @@
 
 public:
+	/* common utilities */
 	void	ReleaseInstance				(void);
 
@@ -48,7 +47,14 @@
 	void	Close						(void);
 
-	int		GetStatus					(void);
+public:
+	/* interface to filter */
+	void	SetRequestFilter			(const E_CRX_FILTER_REQUEST	aType,
+										 const bool					aIsMatched,
+										 const std::string			aValue);
+	void	RemoveRequestFilter			(const E_CRX_FILTER_REQUEST	aType);
+	bool	CheckRequestFilter			(const E_CRX_FILTER_REQUEST	aType);
 
 public:
+	/* for communication */
 	int		Forward						(void);
 
Index: /trunk/src/CRXFilter.cpp
===================================================================
--- /trunk/src/CRXFilter.cpp	(revision 28)
+++ /trunk/src/CRXFilter.cpp	(revision 28)
@@ -0,0 +1,114 @@
+/**
+ * CRXFilter.cpp
+ */
+
+#include "CRXFilter.h"
+
+CRXFilter::CRXFilter (void)
+{
+	/*----------------------------------------------------------------*/
+	/*----------------------------------------------------------------*/
+}
+
+CRXFilter::~CRXFilter (void)
+{
+	/*----------------------------------------------------------------*/
+	/*----------------------------------------------------------------*/
+}
+
+void
+CRXFilter::SetRequestFilter (const E_CRX_FILTER_REQUEST	aType,
+							 const bool					aIsMatched,
+							 const std::string			aValue)
+{
+	bool			aIsExistType = false;
+	S_CRX_FILTER	aNewFilter;
+
+	size_t			aPrevPosition = 0;
+	size_t			aNextPosition = 0;
+	std::string		aNewValue;
+
+	CRXFilter_t::iterator	aIter = mRequestFilterList.begin ();
+
+	/*----------------------------------------------------------------*/
+	for ( ; aIter != mRequestFilterList.end () ; aIter++)
+	{
+		if (aIter->mFilterType == aType)
+		{
+			aIsExistType = true;
+			break;
+		}
+	}
+
+	if (aIsExistType)
+	{
+		aIter->mIsMatched	= aIsMatched;
+		aIter->mValue		+= aValue;
+
+		/* add only new value */
+		for ( /* NO INIT */ ; aNextPosition != std::string::npos
+							; aPrevPosition = aNextPosition + 1)
+		{
+			aNextPosition = aValue.find (FILTER_DELIMITER, aPrevPosition);
+			aNewValue = aValue.substr (aPrevPosition, aNextPosition - aPrevPosition);
+			if (aIter->mValue.find (aNewValue) == std::string::npos)
+				aIter->mValue += aNewValue + FILTER_DELIMITER;
+		}
+	}
+	else
+	{
+		aNewFilter.mFilterType	= aType;
+		aNewFilter.mIsMatched	= aIsMatched;
+		aNewFilter.mValue		= aValue;
+
+		mRequestFilterList.push_back (aNewFilter);
+	}
+	/*----------------------------------------------------------------*/
+}
+
+void
+CRXFilter::RemoveRequestFilter (const E_CRX_FILTER_REQUEST aType)
+{
+	CRXFilter_t::iterator	aIter = mRequestFilterList.begin ();
+
+	/*----------------------------------------------------------------*/
+	for ( ; aIter != mRequestFilterList.end () ; aIter++)
+	{
+		if (aIter->mFilterType == aType)
+		{
+			mRequestFilterList.erase (aIter);
+			break;
+		}
+	}
+	/*----------------------------------------------------------------*/
+}
+
+bool
+CRXFilter::CheckRequestFilter (const E_CRX_FILTER_REQUEST	aType,
+							   const CRXHttpRequest			& aRequest)
+{
+	bool	aResult		= false;
+
+	size_t	aPosition	= std::string::npos;
+
+	bool	aIsMatched	= false;
+	bool	aIsFound	= false;
+
+	CRXFilter_t::iterator	aIter = mRequestFilterList.begin ();
+
+	/*----------------------------------------------------------------*/
+	for ( ; aIter != mRequestFilterList.end () ; aIter++)
+	{
+		if (aIter->mFilterType == aType)
+		{
+			aPosition	= aIter->mValue.find (aRequest.GetFileExtension ());
+			aIsMatched	= aIter->mIsMatched;
+			break;
+		}
+	}
+	/*----------------------------------------------------------------*/
+
+	aIsFound = aPosition == std::string::npos ? false : true;
+
+	return aIsFound && aIsMatched;
+}
Index: /trunk/src/CRXHttpMessage.cpp
===================================================================
--- /trunk/src/CRXHttpMessage.cpp	(revision 27)
+++ /trunk/src/CRXHttpMessage.cpp	(revision 28)
@@ -68,5 +68,4 @@
 {
 	/*----------------------------------------------------------------*/
-	SetMessage (aHttpMessage);
 	/*----------------------------------------------------------------*/
 
Index: /trunk/src/CRXHttpRequest.cpp
===================================================================
--- /trunk/src/CRXHttpRequest.cpp	(revision 27)
+++ /trunk/src/CRXHttpRequest.cpp	(revision 28)
@@ -50,31 +50,4 @@
 }
 
-std::string
-CRXHttpRequest::GetURL (void) const
-{
-	/*----------------------------------------------------------------*/
-	/*----------------------------------------------------------------*/
-
-	return mUrl;
-}
-
-std::string
-CRXHttpRequest::GetHost (void) const
-{
-	/*----------------------------------------------------------------*/
-	/*----------------------------------------------------------------*/
-
-	return mHost;
-}
-
-int
-CRXHttpRequest::GetPort (void) const
-{
-	/*----------------------------------------------------------------*/
-	/*----------------------------------------------------------------*/
-
-	return mPort;
-}
-
 CRXHttpRequest &
 CRXHttpRequest::operator = (const char * aHttpMessage)
@@ -90,5 +63,5 @@
 CRXHttpRequest::Parse (void)
 {
-	std::string	aHttpRequestUri		= "";
+	std::string	aHttpRequestUrl;
 
 	char		aMethod[64]			= {0x00, };
@@ -103,13 +76,15 @@
 
 	/*----------------------------------------------------------------*/
-	aHttpRequestUri = GetHeader ().substr (0, mHttpMessage.find ('\r'));
+	aHttpRequestUrl = GetHeader ().substr (0, mHttpMessage.find ('\r'));
 
 	/*----------------------------------------------------------------
 	 * 1. separate first line to <METHOD>, <URL> and <VERSION>
 	 *----------------------------------------------------------------*/
-	sscanf (aHttpRequestUri.c_str (), "%[^ ] %[^ ] %[^ ]\r\n", aMethod, aUrl, aHttpVersion);
+	sscanf (aHttpRequestUrl.c_str (), "%[^ ] %[^ ] %[^ ]\r\n", aMethod, aUrl, aHttpVersion);
 	mMethod.assign (aMethod);
 	mUrl.assign (aUrl);
 	mHttpVersion.assign (aHttpVersion);
+
+	ParseFileExtension ();
 
 	/*----------------------------------------------------------------
@@ -129,2 +104,41 @@
 	/*----------------------------------------------------------------*/
 }
+
+void
+CRXHttpRequest::ParseFileExtension (void)
+{
+	std::string	aFilename;
+
+	size_t		aFilenameOffset		= 0;
+	size_t		aParameterPosition	= 0;
+	size_t		aSlashPosition		= 0;
+	size_t		aDotPosition		= 0;
+
+	/*----------------------------------------------------------------*/
+	/*----------------------------------------------------------------
+	 * 1. get filename
+	 *----------------------------------------------------------------*/
+	aParameterPosition = mUrl.find ('?');
+	aSlashPosition = mUrl.rfind ('/', aParameterPosition) + 1;
+	if (aSlashPosition == mUrl.length ())
+		return ;
+
+	aFilenameOffset	= (aParameterPosition != std::string::npos)
+					? aParameterPosition - aSlashPosition
+					: std::string::npos;
+
+	aFilename = mUrl.substr (aSlashPosition, aFilenameOffset);
+
+	/*----------------------------------------------------------------
+	 * 2. get file extension
+	 *----------------------------------------------------------------*/
+	aDotPosition = aFilename.rfind ('.');
+	if (aDotPosition != std::string::npos)
+		mFileExtension = aFilename.substr (aDotPosition + 1);
+	/*----------------------------------------------------------------*/
+}
+
+std::string	CRXHttpRequest::GetURL				(void) const { return mUrl; }
+std::string	CRXHttpRequest::GetHost				(void) const { return mHost; }
+int			CRXHttpRequest::GetPort				(void) const { return mPort; }
+std::string	CRXHttpRequest::GetFileExtension	(void) const { return mFileExtension; }
Index: /trunk/src/CRXHttpResponse.cpp
===================================================================
--- /trunk/src/CRXHttpResponse.cpp	(revision 27)
+++ /trunk/src/CRXHttpResponse.cpp	(revision 28)
@@ -110,31 +110,4 @@
 
 	return GetMessage ();
-}
-
-int
-CRXHttpResponse::GetStatusCode (void) const
-{
-	/*----------------------------------------------------------------*/
-	/*----------------------------------------------------------------*/
-
-	return mStatusCode;
-}
-
-int
-CRXHttpResponse::GetContentLength (void) const
-{
-	/*----------------------------------------------------------------*/
-	/*----------------------------------------------------------------*/
-
-	return mContentLength;
-}
-
-const char *
-CRXHttpResponse::GetContentBody (void) const
-{
-	/*----------------------------------------------------------------*/
-	/*----------------------------------------------------------------*/
-
-	return mContent.mBody;
 }
 
@@ -232,2 +205,6 @@
 	return aResult;
 }
+
+int				CRXHttpResponse::GetStatusCode		(void) const { return mStatusCode; }
+int				CRXHttpResponse::GetContentLength	(void) const { return mContentLength; }
+const char *	CRXHttpResponse::GetContentBody		(void) const { return mContent.mBody; }
Index: /trunk/src/CRXProxy.cpp
===================================================================
--- /trunk/src/CRXProxy.cpp	(revision 27)
+++ /trunk/src/CRXProxy.cpp	(revision 28)
@@ -7,6 +7,9 @@
 #include <string.h>
 
+CRXFilter CRXProxy::mFilter;
+
 CRXProxy::CRXProxy (void)
-	: mClient (0),
+	: mIsIntercepted (false),
+	  mClient (0),
 	  mServer (0)
 {
@@ -59,11 +62,29 @@
 }
 
-int
-CRXProxy::GetStatus (void)
-{
-	/*----------------------------------------------------------------*/
-	/*----------------------------------------------------------------*/
-
-	return mProxyStatus;
+void
+CRXProxy::SetRequestFilter (const E_CRX_FILTER_REQUEST	aType,
+							const bool					aIsMatched,
+							const std::string			aValue)
+{
+	/*----------------------------------------------------------------*/
+	mFilter.SetRequestFilter (aType, aIsMatched, aValue);
+	/*----------------------------------------------------------------*/
+}
+
+void
+CRXProxy::RemoveRequestFilter (const E_CRX_FILTER_REQUEST aType)
+{
+	/*----------------------------------------------------------------*/
+	mFilter.RemoveRequestFilter (aType);
+	/*----------------------------------------------------------------*/
+}
+
+bool
+CRXProxy::CheckRequestFilter (const E_CRX_FILTER_REQUEST aType)
+{
+	/*----------------------------------------------------------------*/
+	/*----------------------------------------------------------------*/
+
+	return mFilter.CheckRequestFilter (aType, this->mHttpRequest);
 }
 
Index: /trunk/src/main.cpp
===================================================================
--- /trunk/src/main.cpp	(revision 27)
+++ /trunk/src/main.cpp	(revision 28)
@@ -76,4 +76,8 @@
 	CRXProxy	* aProxy = NULL;
 
+	char		* aFilterFileExtension = "exe|gif|jpg|png|css|js|ico|";
+	char		* aHttpRequest = NULL;
+	int			aHttpRequestLength = 0;
+
 	/*----------------------------------------------------------------*/
 	for (;;)
@@ -94,4 +98,7 @@
 
 		aProxy->SetClientSocket (aResult);
+		aProxy->SetRequestFilter (CRX_FILTER_REQUEST_FILE_EXTENSION,
+								  CRX_FILTER_MATCHED,
+								  aFilterFileExtension);
 
 		aResult = aProxy->Forward ();
@@ -99,4 +106,12 @@
 		{
 			cerr << aProxy->GetErrorMessage () << endl;
+		}
+
+		if (!aProxy->CheckRequestFilter (CRX_FILTER_REQUEST_FILE_EXTENSION))
+		{
+			aHttpRequestLength = aProxy->GetHttpRequestLength ();
+			aHttpRequest = (char *) calloc (aHttpRequestLength + 1, 1);
+			cout << aProxy->GetHttpRequest (aHttpRequest, aHttpRequestLength) << endl;
+			free (aHttpRequest);
 		}
 
Index: /trunk/src/makefile
===================================================================
--- /trunk/src/makefile	(revision 27)
+++ /trunk/src/makefile	(revision 28)
@@ -1,3 +1,2 @@
-
 #----------------------------------------------------------
 # platform
