Naughter Software Logo

W3Mfc LogoW3Mfc 1.97 A collection of MFC classes to implement a Web Server, 

CWSocket / CSSLSocket v1.34 An MFC wrapper class for Sockets and SSL,

CThreadPoolServer v1.37 An MFC class framework for Thread pools,

SocServer v1.04 A simple demo server app for CWSocket &

SocClient v1.04 A simple demo client app for CWSocket

Welcome to W3Mfc, a collection of MFC classes to implement a simple Web server.

The idea behind is W3Mfc was originally to learn about the HTTP protocol and how it is implemented on Win32. It is not intended to be a replacement for IIS or Apache. Instead it is designed as a tool for learning or in cases where deployment of a solution on IIS would be considered overkill.

For detailed information about the Hyper Text Transfer Protocol you should read RFC 1945, You can download this from a number of sites by searching for RFC and 1945.

Another document that these classes refer to is RFC 2045 which defines MIME.

Please note that as of v1.87 of W3Mfc, the code is now for Visual C++ 2005 or later. I will not be supporting VC 6 anymore for this code, so please don't email me requesting this<gg>. Remember VC 6 is now a ten+ year old compiler. It's now time to upgrade to VC 2005 or VC 2008!

 

The classes which constitute W3Mfc are:

CHttpServerSettings: This class contains the settings which are used to configure the web server. Example member variables in this class include the virtual directories and the their default filenames. If you are developing a stand alone web server based on W3Mfc, you could for example store all the variables for the CHttpServerSettings instance in an ini file or in the registry.

 

CHttpServer: This is the actual class which implements the web server. It has a number of very simple functions to allow you to control the state of the web server such as Start and Stop. Internally a background thread is spun off to handle the client connections.

 

CWSocket: This is a simple C++/MFC encapsulation of an SDK socket. A class called CHttpSocket is derived for this in the W3MFC web server to provide custom HTTP parsing. The CWSocket class can be using in other projects to provide a simple encapsulation of a socket.

 

CSSLSocket: An encapsulation of a secure sockets connection.

 

CHttpResponseHeader: This class helps in the handling of sending request headers when returning the HTTP responses to clients. It provides a number of methods to allow standard Http headers to be added to the client response.

 

CHttpMimeManager: This class is used when returning client responses. It is used to determine to mime type of a file given its extension type. This information is taken from the registry and is cached in this class. For example files of .htm or .html will normally be of mime type "text/html".

 

CHttpRequest: This class represents a request from a client. It contains information such as the URI of the request, the Http Verb used and the Http version used for the request. A member of this type is stored in the CHttpClient class.

 

CHttpClient: This class is used in the CHttpServer class to handle client connections. It handles the parsing of client requests and returning the appropriate response. A number of virtual functions are provided to allow end user customisation.

 

CHttpDirectory: This class is used by the CHttpClient class to allow per directory customisation of client connections. A number of virtual functions are provided to allow end user customisation.

 

CThreadPoolServer: This class provides the thread pool functionality. To use it in your code, just derive a class from CThreadPoolClient (as is done for the W3MFC web server) and implement your own specific code in CThreadPoolClient::Run. The CThreadPoolServer class can be used in other projects to provide a simple encapsulation of a thread pool.

 

The enclosed zip file contains the W3Mfc source code and a simple console based application which implements a simple web server.

 

Two additional downloads are provided as samples for the CWSocket class. socserver.zip implements a simple single threaded time (RFC 868) sockets server and socclient.zip implements a client for the same. Please note that if you want to compile these examples, then you should copy the SocMFC.cpp/h files from the main W3MFC zip file into the directory where you have downloaded the socclient and socserver samples.

 

Copyright

 

Updates

V1.0 (4 May 1999)

V1.1 (29 June 1999)

V1.11 (29 February 2000)

V1.2 (15 April 2001)

V1.21 (23 April 2001)

V1.01 of CThreadPoolServer (21 July 2001)

V1.02 of CThreadPoolServer / v1.22 of W3MFC (25 July 2001)

V1.03 of CThreadPoolServer / v1.23 of W3MFC (7 August 2001)

V1.04 of CThreadPoolServer / v1.3 of W3MFC (26 August 2001)

V1.01 of CWSocket / v1.31 of W3MFC (30 September 2001)

V1.32 of W3MFC (3 November 2001)

V1.33 of W3MFC / V1.02 of CWSocket / V1.05 of CThreadPoolServer (27 December 2001)

V1.34 of W3MFC / V1.0 of CW32Handle (8 January 2002)

V1.01 of CIOCP9x / V1.35 of W3MFC (26 January 2002)

V1.36 of W3MFC (21 February 2002)

V1.37 of W3MFC (23 March 2002)

31 March 2002

V1.06 of CThreadPoolServer / V1.38 of W3MFC (17 April 2002)

V1.07 of CThreadPoolServer / V1.39 of W3MFC (29 April 2002)

V1.08 of CThreadPoolServer / V1.40 of W3MFC (29 April 2002)

V1.41 of W3MFC (23 May 2002)

V1.42 of W3MFC (24 May 2002)

V1.43 of W3MFC (25 May 2002)

V1.44 of W3MFC (29 May 2002)

V1.45 of W3MFC (30 May 2002)

4 June 2002

V1.46 of W3MFC (14 June 2002)

V1.47 of W3MFC (28 July 2002)

V1.48 of W3MFC (18 August 2002)

V1.09 of CThreadPoolServer (18 August 2002)

V1.10 of CThreadPoolServer (20 August 2002)

V1.11 of CThreadPoolServer (4 October 2002)

V1.12 of CThreadPoolServer (8 October 2002)

V1.13 of CThreadPoolServer (12 October 2002)

V1.14 of CThreadPoolServer (14 October 2002)

V1.49 of W3MFC (17 October 2002)

V1.15 of CThreadPoolServer (17 October 2002)

V1.16 of CThreadPoolServer (17 October 2002)

V1.17 of CThreadPoolServer (7 November 2002)

V1.18 of CThreadPoolServer (10 November 2002)

V1.50 of W3MFC (17 November 2002)

V1.51 of W3MFC (17 November 2002)

V1.52 of W3MFC (18 November 2002)

V1.53 of W3MFC (18 November 2002)

V1.54 of W3MFC (20 November 2002)

25 November 2002

V1.55 of W3MFC (3 February 2003)

V1.56 of W3MFC (21 February 2003)

V1.60 of W3MFC (27 February 2003)

V1.61 of W3MFC (2 March 2003)

V1.62 of W3MFC (3 March 2003)

V1.19 of CThreadPoolServer (3 March 2003)

V1.03 of CWSocket (3 March 2003)

6 April 2003

V1.63 of W3MFC (12 September 2003)

V1.04 of CWSocket (21 September 2003)

V1.05 of CWSocket (26 September 2003)

V1.06 of CWSocket / CSSLSocket (5 October 2003)

V1.64 of W3MFC / V1.07 of CWSocket (3 November 2003)

V1.65 of W3MFC

V1.66 of W3MFC / V1.20 of CThreadPoolServer / V1.08 of CWSocket (13 January 2004)

V1.67 of W3MFC (22 February 2004)

V1.68 of W3MFC (30 March 2004)

V1.0 of SocClient and SocServer (20 August 2004)

V1.69 of W3MFC (26 August 2004)

6 September 2004

V1.70 of W3MFC (15 October 2004)

V1.21 of CThreadPoolServer / V1.71 of W3MFC / V1.09 of CWSocket / V1.01 of CW32Handle(11 November 2004)

V1.22 of CThreadPoolServer (4 December 2004)

V1.10 of CWSocket / CSSLSocket (29 December 2004)

V1.11 of CWSocket / CSSLSocket (31 January 2005)

V1.72 of W3MFC / v1.11 of CWSocket (19 February 2005)

V1.13 of CWSocket / CSSLSocket (1 May 2005)

V1.14 of CWSocket / CSSLSocket (21 June 2005)

V1.23 of CThreadPoolServer (11 September 2005)

V1.73 of W3MFC (30 October 2005)

V1.74 of W3MFC / v1.15 of CWSocket (4 November 2005)

v1.16 of CWSocket (16 November 2005)

v1.17 of CWSocket (27 November 2005)

V1.75 of W3MFC (3 January 2006)

V1.76 of W3MFC (8 February 2006)

V1.77 of W3MFC / v1.18 of CWSocket (19 February 2006)

V1.24 of CThreadPoolServer (13 April 2006)

V1.78 of W3MFC / V1.25 of CThreadPoolServer (31 May 2006)

V1.79 of W3MFC / v1.19 of CWSocket / V1.26 of CThreadPoolServer (27 June 2006)

V1.27 of CThreadPoolServer (6 August 2006)

V1.28 of CThreadPoolServer (8 August 2006)

V1.80 of W3MFC (21 September 2006)

V1.81 of W3MFC (12 January 2007)

V1.01 of SocClient and SocServer (27 January 2007)

V1.82 of W3MFC (9 May 2007)

V1.83 of W3MFC / V1.29 of CThreadPoolServer / V1.02 of CW32Handle / v1.20 of CWSocket (20 November 2007)

v1.84 of W3MFC / v1.21 of CWSocket (26 December 2007)

v1.22 of CWSocket (27 December 2007)

v1.85 of W3MFC / v1.23 of CWSocket (31 December 2007)

v1.86 of W3MFC / v1.24 of CWSocket (2 February 2008)

v1.87 of W3MFC / V1.30 of CThreadPoolServer / v1.25 of CWSocket (19 February 2008)

v1.88 of W3MFC / v1.26 of CWSocket (1 March 2008)

v1.31 of CThreadPoolServer

v1.89 of W3MFC / v1.27 of CWSocket / v1.32 of CThreadPoolServer (31 May 2008)

v1.90 of W3MFC / V1.02 of SocClient and SocServer (8 June 2008)

v1.91 of W3MFC / v1.28 of CWSocket/CSSLSocket / v1.33 of CThreadPoolServer / V1.03 of SocClient and SocServer (24 May 2009)

v1.92 of W3MFC / v1.29 of CWSocket (12 July 2009)

v1.93 of W3MFC

v1.94 of W3MFC / v1.30 of CWSocket / v1.34 of CThreadPoolServer / V1.04 of SocClient and SocServer (9 January 2011)

v1.31 of CWSocket / CSSLSocket (8 February 2011)

v1.32 of CWSocket / CSSLSocket (3 April 2011)

v1.95 of W3MFC / v1.33 of CWSocket / v1.35 of CThreadPoolServer (12 August 2012)

v1.96 of W3MFC / v1.34 of CWSocket / v1.36 of CThreadPoolServer (16 March 2014)

v1.97 of W3MFC / v1.37 of CThreadPoolServer (29 March 2014)

13 April 2014