Code for an HTTP/HTTPS Internet proxy (Open GRiD proxy)
and some generic and Web-specific libraries in C++.
The source code is mostly for developers,
as the functionality of the proxy is not yet very extensive.
The code was developed during an early stage of
the Open GRiD project
in particular to see how and whether additional funcionality
can be provided for existing browsers
by a proxy that filters all HTML documents
adding its own functionality menu to all displayed documents.
This code has been then substantially architecturally redesigned
into the OpenGRiD
project's code.
(Note that the latter does not yet contain an application whose
functionality subsumes that of the OGProxy.)
Features:
-
The proxy works as HTTP/HTTPS proxy.
-
The proxy works with both MSIE and Netscape
and compiles on Linux, Windows, SunOS, and other Unix'es.
-
A special control panel is added to all top-level
html documents to facilitate access to the functions of the proxy.
(The panel is automatically blocked for frames,
so that frame-sets are displayed correctly.
Also the panel can be easily switched on and off manually
or using an URI-pattern for a particular page.)
-
Most proxy parameters can be (remotely) changed on the fly
using a Web browser.
-
The user can easily get the information about the recent and active
requests: the request headers and how the requests were processed.
-
Proxy authorization can be enforced to enhance security
(the proxy is essentially state-full
and manipulates some user data - its options for now).
-
It (for now) unconditionally filters out Java Script and Java code
as well as META-set-cookie HTML code from html's passing through it.
-
It can also intercept refresh directives
and reload headers.
-
It can forward requests to another proxy.
Currently it is advised to use caching proxy such as
Squid
for a UNIX-like system
or WebCelerator
for a Windows-based system after the Open GRiD proxy
as the proxy is lacking any persistent cache
and forces fast expiration of the data it gives to the browser.
-
Some rudimentary memory-only cache functionality is present.
-
Java Script interface enhancements can be used.
-
Welcome screen and other navigation documents are produced.
-
All error messages of the proxy also can be viewed (remotely)
using a browser.
The provided Web-specific library functionality includes:
-
Some manipulations with strings.
-
Core proxy functionality,
using a uni-process data-driven model based on the select() call.
-
Flexible filtering of (HTML) streams.
-
Parsing and other manipulations with HTML and HTTP elements.
-
Creation and handling of forms enabling to change a set of options
of different types;
the options can also be saved to and read from a file.
-
Html-generation facilitating classes.
-
Generic least-recently-used cache classes.
-
Classes for managing lists of regular expression patterns.
The provided general C++ library functionality includes:
-
Flexible compilable-out debugging messages and runtime checks.
-
Very good memory leaks and other memory errors detection support:
-
memory leaks can be traced after program execution
back to the place of allocation including 3 stack frames
of function call history (you will need gdb for this).
-
fields around allocated objects are added to help detect
out-of bounds memory accesses
-
new memory is garbage-initialized to help catch use
of uninitialized fields
-
freed memory is garbage-cleaned and kept around for a while
to help catch the use of dangling pointers
-
Facilitation of runtime checks for objects of different classes.
-
Performs hierarchical initializations and
"finalizations" of "modules".
-
Class wrappers to make the use of STL containers more efficient.
-
One can use MODULA-like syntax in C++.