_____________________________________________________________________________

                                   T u b e

                                 TCP Tunnel

                          by David Thomas,  1997-9
                         version 0.92 (17 Jul 1999)
_____________________________________________________________________________


 Introduction ______________________________________________________________

  Tube is a TCP Tunnel; a "transparent" proxy which when connected to,
connects to another server and relays all data exchanged between the two
connections.

  This is useful for people behind firewalls who find they can't access
certain outside resources due to ports being blocked.

  >> Be careful not to breach your network's security when using Tube! <<


 Usage _____________________________________________________________________

  Run Tube with the filename of a file like this:

# Tube configuration file
#
ProxyBufferSize	512
ProxyPort	2001
RemoteHost	news.isp.com
RemoteHostPort	119
MaxConnections	4
ClientSubst	spanners@kid.co.uk,dave@whizz.com
ServerSubst	dave@whizz.com,spanners@kid.co.uk

Lines beginning with '#' are comments.  Identifiers ('ProxyPort') and values
('2001') MUST be separated by the Tab character.

  ProxyBufferSize  the size of the buffer used for each side of the
                   connection.  Increase this value for higher performance.
                   There is a practical limit of 512 bytes if you intend to
                   use string substitution.

  ProxyPort        the port that the proxy will run on.  This
                   can be any value from 1 to 65535, although you are
                   advised to pick a port number greater than 1024.

  RemoteHost       the computer the proxy will connect to.

  RemoteHostPort   the port number the proxy will connect to. (e.g. 80
                   for a web server, 119 for a news server, 8080 for a web
                   proxy, etc.)

  MaxConnections   sets the maximum number of simultaneous connections the
                   server will handle.

  ClientSubst      takes a string such as "fred,joe", and if the string
  ServerSubst      "fred" is found, "joe" is substituted.  This is provided
                   to allow dynamic translation of news postings, so that
                   articles appear to be coming from the correct machine.
                   You can any number of substitution lines.  ClientSubst
                   substitutes text travelling from the client.  ServerSubst
                   substitutes text travelling from the server.

                   You should only use substitution on text links.


 Warnings __________________________________________________________________

  TUBE CAN SERIOUSLY SUCK THE LIFE OUT OF YOUR COMPUTER!
 
   If it were written specifically for RISC OS, it would be a desktop
   application.  If it were written specifically for UNIX, it would use
   fork().  However, it's written to work on both systems, so sacrifices
   niceness for portabilty.
   
   On RISC OS it will sleep if nothing is happening.  On UNIX you are advised
   to 'nice' it.

  If you are using string substitutions, then those connections will be
   limited to passing at most 512-byte strings.  This is because NNTP is
   limited to that length.

  When using substitution, output is only written when the client sends the
   end-of-line codes CR and/or LF.

  The lines in configuration files should not exceed 256 characters
   (including terminator.)


 History ___________________________________________________________________

0.92 (22 Jan 1999)

 - Reorganised into a single select() statement, rather than using separate
   ones for the connection and data sockets.

 - Now dependent on Internet 5 for it's taskwindow sleeping feature, this
   allows tube to not sap the desktop's strength when idling. yay! :-)

 - There was a printf after a connection_halfclose for errored writes,
   meaning that the errored socket was reported as -1.

 - &server passed as a parameter into subroutines.  This slightly cleaner but
   server still needs to be global to the atexit handler can use it.


0.80 (21 Jan 1998)

 - Will now theoretically cope with an infinite number of connections and
   substitutions, on either side of the connection.

 - If no substitutions are needed then a fast method is used.  This is
   independent of side, so one side can be 'fast' whilst the other can be
   running 'slow'.

 - Can now configure the proxy buffer sizes.


0.35 (31 Dec 1997)

 - First release version.
 - Renamed to 'Tube' from 'NewsProxy' to reflect its genericity.


 Copyright _________________________________________________________________

  This software (Tube) is copyrighted work of David Thomas, it is supplied
as is; using it is entirely at your own risk.  I provide no warranty as to
the fitness of this software for any purpose.  You are free to distribute
this application to anyone you may wish, as long as you are not supplying it
for personal or commercial profit and it is supplied with all of the
software's files complete and unmodified.

  Email: dpt@tristone.co.uk

    Web: http://www.tristone.co.uk/davespace/

   Post: Mr D. P. Thomas
         20 Rosebery Avenue
         Waterloo
         Liverpool
         L22 2BH
_____________________________________________________________________________

