summaryrefslogtreecommitdiff
path: root/src/conns.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2004-01-26Added reverse proxy support from Kim Holviala. His comments regardingRobert James Kaes1-1/+10
this addition follow: The patch implements a simple reverse proxy (with one funky extra feature). It has all the regular features: mapping remote servers to local namespace (ReversePath), disabling forward proxying (ReverseOnly) and HTTP redirect rewriting (ReverseBaseURL). The funky feature is this: You map Google to /google/ and the Google front page opens up fine. Type in stuff and click "Google Search" and you'll get an error from tinyproxy. Reason for this is that Google's form submits to "/search" which unfortunately bypasses our /google/ mapping (if they'd submit to "search" without the slash it would have worked ok). Turn on ReverseMagic and it starts working.... ReverseMagic "hijacks" one cookie which it sends to the client browser. This cookie contains the current reverse proxy path mapping (in the above case /google/) so that even if the site uses absolute links the reverse proxy still knows where to map the request. And yes, it works. No, I've never seen this done before - I couldn't find _any_ working OSS reverse proxies, and the commercial ones I've seen try to parse the page and fix all links (in the above case changing "/search" to "/google/search"). The problem with modifying the html is that it might not be parsable (very common) or it might be encoded so that the proxy can't read it (mod_gzip or likes). Hope you like that patch. One caveat - I haven't coded with C in like three years so my code might be a bit messy.... There shouldn't be any security problems thou, but you never know. I did all the stuff out of my memory without reading any RFC's, but I tested everything with Moz, Konq, IE6, Links and Lynx and they all worked fine.
2003-08-01Included patches from Steven Young to use the hashmap functionality toRobert James Kaes1-13/+3
manage the HTML error pages. It simplifies the source, and also make the object file smaller. Nice. Also added any casting from (void*) to ensure that the code compiles using a C++ compiler.
2003-07-31Added appropriate casts from (void*) so that the code will compileRobert James Kaes1-2/+2
cleanly with a C++ compiler. (Tested using GCC 3.3)
2003-05-31# Changed all the for calls to use the != test rather than < test.Robert James Kaes1-2/+2
The change was recommended in the C/C++ User Journal magazine.
2003-05-04Fixed a bug that would kill a child process because of an invalidRobert James Kaes1-2/+2
safefree() call. Basically, destroy_conn() was trying to free memory not allocated by malloc. [Fix by David T. Pierson]
2003-04-16Removed the remote_content_length field in the "conn" structure andRobert James Kaes1-2/+3
replaced it with a smaller structure containing both the remote/server and the local/client content-length fields if they're present in the HTTP response headers.
2003-03-13# Added variables to keep track of the variables to be substituted inRobert James Kaes1-1/+15
.html files displayed to the client [Steven Young]
2002-11-13(destroy_conn): Added code to log any error messages when the socketsRobert James Kaes1-3/+8
are closed.
2002-05-24Fixed a tonne of spelling mistakes.Robert James Kaes1-3/+3
2002-05-23Added the peer's socket information to the connection structure. TheRobert James Kaes1-3/+11
information is passed along during the initialization of the structure.
2002-04-18The stats now wait until after the client has finished sending all itsRobert James Kaes1-1/+2
headers before sending the HTTP response back. This should be more standards compliant.
2002-04-15Changed the error boolean flag into a pointer to an error string and anRobert James Kaes1-2/+8
error code. We're storing this information because tinyproxy doesn't output the error information until _after_ the client has sent it's information.
2002-04-11Added the remote_content_length variable to store the number of bytes theRobert James Kaes1-1/+3
remote server is supposed to be transmiting to the client.
2002-04-07Cleaned up some of the code to handle errors better. Also, a little bitRobert James Kaes1-7/+50
easier to read in the variable department.
2001-11-25Removed some of the members of the structures and renamed a few others.Robert James Kaes1-6/+3
2001-11-22Reformated text.Robert James Kaes1-3/+5
2001-11-21Include the protocol variables in the conn_s structure.Robert James Kaes1-1/+3
2001-10-25Moved the connection creation/destruction and definition into it's ownRobert James Kaes1-0/+58
files.
2000-09-11These files are no longer used within tinyproxy.Robert James Kaes1-187/+0
2000-02-16This commit was generated by cvs2svn to compensate for changes in r2,Steven Young1-0/+187
which included commits to RCS files with non-trunk default branches.