/* $Id: README,v 1.9 1997/05/03 11:57:20 lexa Exp $ */

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

	  ,  Vadim Kurland  Mike Shoyher

 Copyright Notice

    ,      
  .    ,   
.

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

        .
          , 
        :
 -       
 -        lexa@lexa.ru

       ,  
   (lexa@lexa.ru).     -  
    ,       
'Reference' -  ( e-mail')  ,    
   () .      
   .
  ,   " "   .

 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    
	,      . Idea from
	Alexander Nikolaev (ati@samovar.ru).        
	.
 
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
 - pop, smtp -   default,   , 
	  Content-Type: text/plain; charset=some_charset,  
	harset=     
	charset. POP gateway      ->,
        SMTP-gateway -   -.
 - http    -   http-     
	 text/*  application/x-www-form-urlencoded.  , 
 	     'emailcharset' ( ),
	   charset  HTTP- content-type
	( POP-gateway)
 
 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 
     SUBDIRS  Makefile (subdirs :
   discover -- ,       
	  
   cyrcoder --    )
    
		make all
     e   

)   ,   config.gen   
     (hostnames  ).

) 'make install-bin', 'make install-config'  'make install-tables' 
 , - ( config.gen  $CONF_FILE) 
    .
      -- 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

) emailcharset
   charset   Content-Type (POP, SMTP, HTTP)
emailcharset encoding_name server-charset client-charset

encoding-name -     encoding
server-charset - ,  SMTP_gateway   
	Content-Type: text/plain; charset=server-charset
client-charset - Charset,       POP3
	 HTTP gateway

    emailcharset,  HTTP-gateway  
charset  Content-Type __      charset 
   .
 POP3  SMTP    . ..    
    ,      
      . ..  
 ( ) 
Content-Type: text/plain; charset=some
 some    charset,  .



:
emailcharset win koi8-r windows-1251

) 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.  .
   ,     , 
    Gateways     . ,
      charset=  E-mail  HTTP,    .
     :    
 ( )    ,      
 . :

 )   charset    ( ) :

 encoding win  win-koi8 koi8-win 
 encoding win2  win-koi8 koi8-win 
 emailcharset win2  koi8-r windows-1251
 encprecedence PV
 peer 1.2.3.4 win2
 virtualhost win.my.domain win


 )      :

 encoding win  win-koi8 koi8-win 
 encoding win2  win-koi8 koi8-win 
 emailcharset win2  koi8-r windows-1251


 virtualhost win.my.domain win
 virtualhost win-2.my.domain win2



7. 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-'

    ,    "   
 " cyrproxy      -   
 http-,        localhost. 
     :),   'Russian Apache' by Dmitry Kryukov 
 (dvk@stack.net) and Alex Tutubalin  http://apache.lexa.ru/   
  -      

) POP3.
     .

) Telnet.
     telnetGW  .    
   telnet  FreeBSD,   .

) Gopher. 
 ,      .   gopherGW 
  ,     .


8. Feedback. 


   . 

        .  
       ,       
   "   ZUINIX  " (- 
  -   :).   ,    
 :
 )    .     OS, 
  ,  make      , 
   , make  (..  ).    
     ,  .
 )       .   
  DEBUG_LOG  NETWORK_DEBUG  policy.h   cyrproxy.
     , cyrproxy.conf   .
      OS,   . 


 Bugfix,    OS .

     ,  cyrproxy  - OS 
    feature -  ,   
  .  ,    ( , ,
    )      cyrproxy.

         (   ,  
  ).      features:
 -   autoconf/configure
 -   Accept:  HTTP 
 -    gateways

    lexa@lexa.ru

 9. Home site.
        
  ftp://ftp.lexa.ru/pub/domestic/lexa.
     relcom.unix (FIDO: RU.UNIX)

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

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

 Regards,
 Alex Tutubalin, lexa@lexa.ru				3-May-1997
 
