/* $Id: README,v 1.7 1996/10/27 14:08:13 lexa Exp $ */

	cyrproxy -     .
	
	(C) 1996, Alex Tutubalin <lexa@lexa.ru>


 Copyright Notice

    ,      
  .    ,   
.

      transl  , 
     Telnet  Gopher  
transl   . ,  HTTP-
  ,      , 
  (dima@elvis.ru).        
      ,      ,
  HTTP-   .

        .
          , 
        :
 -       
 -        lexa@lexa.ru

       ,  
   (lexa@lexa.ru). 

 BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.

0.      .
 
      - cyrproxy,   
      , http, gopher, telnet.
          .
   :
 cyrproxy -     tcp-.     
	       ,   
 spy      - ,    tcp-  .
 	    . README.spy (    :).     HTTP-.
 discover - ,      
 	      ,    .
 cyrtrans - - (stdin->stdout)
 transfiles - ,      cyrtrans
 transtree -     
 cyrwww   - WWW-  cyrtrans.   Paste    ,
                 

 
1.    (  ).
  cyrproxy   inetd   
    tcp-    ip .   
  :

 $ tail /etc/services:

 smtp-cyr 10025/tcp  # SMTP-    :)
 smtp-old 25/tcp    #   ,   SMTP

 $ tail /etc/inetd.conf

 smtp-old stream tcp nowait root /usr/local/libexec/cyrproxy cyrproxy -p smtp-cyr -h localhost

     25-     ""  
 10025  localhost  () . 

1.   .
     ( ) /  
  .         
        (   
  ).       
 (    ),      , 
     ip-a (   aliases  
 ),  koi8.lexa.ru  win.lexa.ru,     
    ,   ()    
   destination address.

   (     )     dotted 
 notation,    (host.my.domain) .    
      IP-     
  . ,    c   
  resolver.

1.. Gateways.
 ,  "  "     
  __  (SMTP, POP3, NNTP).    
 (telnet, gopher, http)      ,   
      .        
  "Gateways".     
 - default -    ,     
 - telnet  -  telnet protocol
 - gopher  -   gopher
 - http    -   http-     
	 text/plain
 
 gateway - - default.        
  ,   TOS       config file.

1. Transparent Gateway
   " "     .   
    transparent host.    ,   
   destination   ,   transparent host,
           cat.

1. Transparent Exec
   Transparent Exec (      )
    ,     ,   
   TCP-.    , ,   ,  
        Peer. .., , 
      25-   ,   sendmail 
     ,    sendmail'  'relay'  
    localhost,  .
   :
    - ,    MX ( mx.lexa.ru)  
      TransparentHost'    cyrproxy.
    -        ""  (exec') 
      sendmail,        
    -      virtualhosts ({koi8,win}.lexa.ru) 
      -   .

2. Installation.

a)  policy.h      ( 
    ).
      configfile     Makefile 
     build_subdirs  Makefile (subdirs :
   discover -- ,       
	  
   cyrcoder --    )
    
		make all
     e   

)   ,   cyrproxy.conf.tmpl.   
     (hostnames  ).

) 'make install-bin', 'make install-config'  'make install-tables' 
 , -     .
      -- make install


3.  . 
     256 .    
 (  )    ,    
 " ",  - " ".   256-  
    : recoded_char = table[original_char];

4.   

(  - /etc/cyrproxy.conf.    makefile)
   -   (  #,   ,
 option-name value(s)  

 options  :

a) tabledir
tabledir - pp,      (
    Makefile:

tabledir /usr/local/share/proxy


) encoding
 :
encoding name table_from_client table_to_client
name -  ,   ,    ,
	 $tabledir.
  -  ->,  - . 
	  NONE ,    
	  (,    table[i] = i)

:

encoding koi8 NONE NONE
encoding alt  koi8-alt alt-koi8
encoding win  koi8-win win-koi8


) transparenthost - .  "5.  "

:
transparenthost ns.lexa.ru

) encprecedence -      .

       (Peer)    
 (Virtual host).     encprecedence. 
    - VP  PV,  ,    
  Virtualhost,  -  ,    ,
 ,     Peer,    ,   
,   default.
 :

encprecedence VP

) default -    ( ). 
  - default <name> (<name> -      ).
 :

default koi8

) gwprecedence. -    gateway (c ). 
Gateway     :
 -     (   config-file )
 -    (    )
 -    TOS (Type of service)  TCP-.

 gwprecedence     PT (   
,   TOS)  TP ( TOS,    ).

gwprecedence  PT

) option
 -  gateway      TOS.
     (       
 gateways - telnet, gopher, http)

option port 23 protocol telnet
option port 70 protocol gopher
option port 8080 protocol http
option tos  16 protocol telnet

) peer -     .   __ 
     .

:
peer <address> <encoding>
 <address> - IP-  domain name
<encoding> -   ,  .

:
peer 1.2.3.4 win

) Virtualhost -     .   
 -  virtualhost      
  __ .
:
virtualhost address encoding
 address  -      (dotted notation or 
		domain name)
encoding -    .

:

virtualhost win.lexa.ru  win

5.   .

     inetd.     
 :
)  :
 -p port -  ( /etc/services)   ,    
   ""
 -h host -    ,     .

) :
 -c configfile -  configfile     
 (     Makefile,    /etc/cyrproxy.conf)
 
 -t timeout ( ) -      ( 
      ,           )
 
 -g gwname (gwname -    default, telnet, gopher, http) -  
	 gateway,       /TOS
 
 -e encname -         .

  -T -   Transparent Host      
	 .

  -R -   Transparent Exec.     transparent host 
     mode (  ,   -T     destination address)
       execp() c  :
        -     -R
        (argv[0]...) -   ,   
       .

6. Different software notes

) sendmail.
  ,      sendmail     
 .    ,    
  port=getservbyname("smtp")        .
 __    smtp  /etc/services.
    (  /etc/services  /etc/inetd.conf):

$ tail /etc/services
 smtp	25/tcp
 smtp2  10025/tcp #      

$ tail /etc/inetd.conf
 #   25   smtp2
 smtp	stream tcp nowait root /sbin/cyrproxy cyrproxy -p smtp2 -h localhost
 #  sendmail  inetd mode
 smtp2  stream tcp nowait root /usr/sbin/sendmail sendmail -bs

      , :
 -    smtp ( ,      
    )     25,  smtp ,
   sendmail      ,    
   (25-)     .
        .

  sendmail    -R ,  
    relays       secure 
mode (i.e.   HELO   peer).

) HTTP-servers.
   httpGW    ,     
 proxy.        -  
 http-proxies (Squid, Harvest, CERN, Apache 1.1).
    ,  WWW-proxy , ,   8000, 
   -   8080 ( -p 8000 -h localhost).
 , WWW-browser'      virtualhosts 
    Proxy   8080   .
 
     , ,  " 
 WWW-server".   , ,    gateway  
      inetd.conf.  ,  HTTP-
 ""   80,     
  -p 80 -h localhost -e win -g http  -    'Windows-'
  -p 80 -h localhost -e msdos -g http  -    'MSDOS-'

) POP3.
     .

) Telnet.
     telnetGW  .    
   telnet  FreeBSD,   .

) Gopher. 
 ,      .   gopherGW 
  ,     .


7. Feedback. 
         (   ,  
  ).      features:
 - Public avaliable HTTP-gateway ( Now in alpha-quality version)
 -   autoconf/configure
 -  Charset   (btw,      ,
        - ).
 -  http-proxy.
 -   Accept:  HTTP (-  )
 -    gateways

    lexa@lexa.ru

 8. Home site.
        
  ftp://ftp.lexa.ru/pub/domestic/lexa
  , {ftp,www}.lexa.ru   Point-of-presence  Internet
     __ .    
      http://www.lexa.ru.  
      http://www.lexa.ru/joinus.html

 9.   :)
         Macintosh,   .
       " Eudora ,   Netscape - ".   
     --   .   --   
  (mac-iso, mac-alt, mac-win, mac-koi8) :)

 10. 
       .      , 
        -  . 
   :
 Dmitry Barabanov <dmitry@irex.ru>
 Bill Fick <fick@glas.apc.org>
 Alexey Pialkin <pialkin@abel.pdmi.ras.ru>
 ...
   .
 

 Regards,
 Alex Tutubalin, lexa@lexa.ru				27-Oct-1996
 
