The Reference Manual of DeleGate version 6.1
Copyright (c) 1994-2000 Yutaka Sato <ysato@etl.go.jp> <ysato@delegate.org>
Copyright (c) 1994-2000 Electrotechnical Laboratory (ETL), AIST, MITI

Permission to use, copy, and distribute (via publically accessible on-line media) this material for any purpose and without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. ETL makes no representations about the accuracy or suitability of this material for any purpose. it is provided "as is", without any express or implied warranties.


This document is written based on the latest version of DeleGate/6.1.X. Users are strongly recommended to use DeleGate/6.X rather than DeleGate/5.X or former versions, since 6.1 is less buggy and more stable than formers.
Comments about this document are expected to be directed to mailto:feedback@delegate.org to be open and shared at http://www.delegate.org/feedback/. Watch DeleGate Home Page at http://www.delegate.org/ to see the latest status. Beginners are recommended to read a short tutorial at http://www.delegate.org/delegate/tutorial/ also.
INDEX
--------- --------- --------- --------- --------- --------- --------- ---------
DELEGATED(8)                MAINTENANCE COMMANDS                   DELEGATED(8)

NAME

SYNOPSIS DESCRIPTION

OPTIONS

   -P option  --  entrance port(s) to the DeleGate
              ==  -Pport[,port]*
        port  ==  [host:]portNum[/udp]
     portNum  ==  number[-number]
   -f option  --  foreground execution
   -v option  --  logging level control
              ==  -v[vdts]
   -S option  --  watch SIGCHLD signal
   -T option  --  trace system calls
              ==  -T[xsdt]*
   -F option  --  extra function
              ==  -Ffunction
   -- option  --  hiding command line arguments
   parameter  ==  name=value
   -e option  ==  -ename=value
Terminology PARAMETERS

General

Routing Access control Resource usage restriction Cache control Mount Data conversion Filter control Local file usage Host name resolution Protocol specific
SERVER parameter*   ==  SERVER=protocol[://host[:portNum]][:-:MountOptions]
           portNum  ==  [+|-]number
                    --  default: none (act as generalist)
ADMIN parameter     ==  ADMIN=user@host.domain
                    --  default: built in at compile time
OWNER parameter*    ==  OWNER=user[/group][:srcHostList]
                    --  default: OWNER="nobody/nogroup"
                    --  restriction: super-user only on most of Unix
CRON parameter*     ==  CRON="crontab-spec"
       crontab-spec ==  minute hour day month dayOfWeek action
                    --  default: none
INETD parameter*    ==  INETD="inetd-conf"
        inetd-conf  ==  port sockType proto waitStat uid execPath argList
              port  ==  [host:]portNum
          sockType  ==  stream | dgram
             proto  ==  tcp | udp
          waitStat  ==  nowait ("wait" is not yet supported)
                    --  default: none
CMAP parameter*     ==  CMAP=resultStr:mapName:connMap
           connMap  ==  ProtoList:dstHostList:srcHostList
                    --  default: none
LIBPATH parameter   ==  LIBPATH=dirPath[:dirPath]*
                    --  default: LIBPATH='.:${STARTDIR}:${LIBDIR}:${EXECDIR}'
DGPATH parameter    ==  DGPATH=dirPath[:dirPath]*
                    --  default: DGPATH='+:.:${HOME}/delegate'
DGOPTS parameter    ==  DGOPTS=opt[,opt]*
                    --  default: none
PORT parameter      ==  PORT=port[,port]*
              port  ==  [host:]portNum[/udp]
           portNum  ==  number[-number]
                    --  default: none
ROUTE parameter*    ==  ROUTE=proto://host:port/-_-dstHostList:srcHostList
                    --  default: none
MASTER parameter*   ==  MASTER=host:port[/masterControl][:dstHostList]
                    --  default: none
MASTERP parameter   ==  MASTERP=[host:port]
                    --  default: none
RPORT parameter     ==  RPORT={tcp|udp}[:host]
                    --  default: none
PROXY parameter*    ==  PROXY=host:port[:dstHostList]
                    --  default: none
SOCKS parameter*    ==  SOCKS=host[:[port][/-4][:dstHostList[:srcHostList]]]
                    --  default: none
SSLTUNNEL parameter ==  SSLTUNNEL=host:port
                    --  default: none
VSAP parameter      ==  VSAP=host:port
                    --  default: none
CONNECT parameter*  ==  CONNECT=connSeq[:connMap]
           connSeq  ==  connType[,connType]*
          connType  ==  cache|icp|master|https|vsap|direct|socks|udp
           connMap  ==  ProtoList[:dstHostList[:srcHostList]]
                    --  default: CONNECT="c,i,m,h,d,v,s:*:*"
TUNNEL parameter    ==  TUNNEL=tunnelType:script
        tunnelType  ==  tty7
                    --  default: none
PERMIT parameter*   ==  PERMIT=connMap
           connMap  ==  ProtoList:dstHostList:srcHostList
                    --  default: none
REMITTABLE parameter == REMITTABLE=ProtoList
                    --  default: REMITTABLE="*" for generalist
                    --  default: REMITTABLE="." for specialist
REACHABLE parameter* ==  REACHABLE=dstHostList
                    --  default: REACHABLE="*" (any host is reachable)
RELIABLE parameter* ==  RELIABLE=srcHostList
                    --  default: RELIABLE=".localnet"
RELAY parameter*    ==  RELAY=relayTypeList[:connMap]
     relayTypeList  ==  relayType[,relayType]*
         relayType  ==  proxy | delegate | no
           connMap  ==  ProtoList:dstHostList:srcHostList
                    --  default: RELAY="proxy,delegate:*:*:.localnet"
                                 RELAY="proxy:*:*:*"
AUTH parameter*     ==  AUTH=what:authProto:who
                    --  default: none
AUTHORIZER parameter ==  AUTHORIZER=authServList[:connMap]
       authServList  ==  authServ[,authServ]* | & | *
           authServ  ==  authHost[/portNum]
           authHost  ==  hostName | hostAddr
            connMap  ==  ProtoList:dstHostList:srcHostList
                    --  default: none
                    --  restriction: applicable to Telnet, FTP and NNTP
RIDENT parameter    ==  RIDENT=ridentType[,ridentType]*
       ridentType   ==  client | server
                    --  default: none
MAXIMA parameter    ==  MAXIMA=what:number,...
                    --  default: MAXIMA=listen:20,ftpcc:2,...
TIMEOUT parameter*  ==  TIMEOUT=what:seconds,...
                    --  default: TIMEOUT=dns:60,acc:30,con:30,lin:30,...
DELAY parameter*    ==  DELAY=what:seconds
                    --  default: DELAY=reject:60,unknown:60,...
MOUNT parameter*    ==  MOUNT="vURL rURL [MountOptions]"
                    --  default: MOUNT="/* SERVER_URL*"
MountOptions == option[,option]*
URICONV parameter*  ==  URICONV={convSpec|defElem|defAttr}
          convSpec  ==  convList:attrList
           defElem  ==  defelem:+,elemnameList
           defAttr  ==  defattr:+,attrnameList
                    --  default: it will be shown by URICONV=dump
BASEURL parameter   ==  BASEURL=URL
                    --  default: none
DELEGATE parameter  ==  DELEGATE=gwHost:Port[:ProtoList]
                    --  default: DELEGATE=currentHost:currentPort
CACHE parameter*    ==  CACHE=cacheControl[,cacheControl]*
      cacheControl  ==  do | no | ro
                    --  default: none
                    --  restriction: applicable to HTTP, FTP, NNTP and Gopher
EXPIRE parameter*   ==  EXPIRE=validity[/custody][:connMap]
           connMap  ==  ProtoList:dstHostList:srcHostList
          validity  ==  period
           custody  ==  period
            period  ==  Num[d|h|m|s]
                    --  default: EXPIRE=1d

CACHEFILE parameter ==  CACHEFILE=fileNameSpec
                    --  default: CACHEFILE='$[server:%P/%L/%p]'

ICP parameter*      ==  ICP=icpServerList[:icpServerSpec[:connMap]]
     icpServerList  ==  icpServer[,icpServer]*
         icpServer  ==  icpHost[/icpType/proxyPort/icpPort]
     icpServerSpec  ==  icpOptions:proxyPort:icpPort
           connMap  ==  ProtoList:dstHostList:srcHostList
                    --  default: none
                    --  restriction: applicable to {HTTP,FTP}-DeleGate

CHARCODE parameter  ==  CHARCODE=[inputCode/]outputCode
        outputCode  ==  charCode
          charCode  ==  JIS | EUC | SJIS | UTF8
                    --  default: none
HTMLCONV parameter  ==  HTMLCONV=convList
          convList  ==  conv[,conv]*
              conv  ==  deent | enent | fullurl
                    --  default: HTMLCONV=deent
MIMECONV parameter  ==  MIMECONV=mimeConv[,mimeConv]
          mimeConv  ==  thru | charcode
                    --  default: none
                    --  MIMECONV="" if CHARCODE parameter is given
FCL parameter       ==  FCL=filterCommand
FTOCL parameter     ==  FTOCL=filterCommand
FFROMCL parameter   ==  FFROMCL=filterCommand
FSV parameter       ==  FSV=filterCommand
FTOSV parameter     ==  FTOSV=filterCommand
FFROMSV parameter   ==  FFROMSV=filterCommand
FMD parameter       ==  FMD=filterCommand
FTOMD parameter     ==  FTOMD=filterCommand
FFROMMD parameter   ==  FFROMMD=filterCommand
                    --  default: none
XCOM parameter      ==  XCOM=filterCommand
XFIL parameter      ==  XFIL=filterCommand
                    --  default: none
CHROOT parameter    ==  CHROOT=dirPath
                    --  default:  none
                    --  restriction: super-user only on most of Unix
DGROOT parameter    ==  DGROOT=dirPath
                    --  default:  on Unix: '${HOME}/delegate' or
                                           '/var/spool/delegate-${OWNER}' or
                                           '/tmp/delegate-${OWNER}'
                               on Windows: '/Program Files/DeleGate'
SHARE parameter     ==  SHARE=dirPatternList
                    --  default: empty
UMASK parameter     ==  UMASK=mask
                    --  default: the value of umask(2)

VARDIR parameter    ==  VARDIR=dirPath
                    --  default: VARDIR='${DGROOT?&:/var/spool/delegate}'
CACHEDIR parameter  ==  CACHEDIR=dirPath
                    --  default: CACHEDIR='${VARDIR}/cache'
ETCDIR parameter    ==  ETCDIR=dirPath
                    --  default: ETCDIR='${VARDIR}/etc'
LOGDIR parameter    ==  LOGDIR=dirPath
                    --  default: LOGDIR='${VARDIR}/log'
LOGFILE parameter   ==  LOGFILE=[LogFilename]
PROTOLOG parameter  ==  PROTOLOG=[LogFilename][:logFormat]
ERRORLOG parameter  ==  ERRORLOG=LogFilename
TRACELOG parameter  ==  TRACELOG=LogFilename
                    --  default: LOGFILE='${LOGDIR}/${PORT}'
                    --  default: PROTOLOG='${LOGDIR}/${PORT}.${PROTO}'
                    --  default: ERRORLOG='${LOGDIR}/errors.log'
                    --  default: TRACELOG='${LOGDIR}/ptrace.log'

LogFilename and dirPath Substitution for Aging

EXPIRELOG parameter ==  EXPIRELOG=LogFilename
                    --  default: EXPIRELOG='${LOGDIR}/expire.log'
WORKDIR parameter   ==  WORKDIR=dirPath
                    --  default: WORKDIR='${VARDIR}/work/${PORT}'
ACTDIR parameter    ==  ACTDIR=dirPath
TMPDIR parameter    ==  TMPDIR=dirPath
PIDFILE parameter   ==  PIDFILE=fileName
                    --  default: ACTDIR='${DGROOT}/act'
                    --  default: TMPDIR=system dependent
                    --  default: PIDFILE='${ACTDIR}/pid/${PORT}'
HOSTS parameter*    ==  HOSTS=nameList[/addrList]
          nameList  ==  name | {name[,name]*}
          addrList  ==  addr | {addr[,addr]*}
                    --  default: HOSTS=localhost/127.0.0.1
RESOLV parameter    ==  RESOLV=[resolver[,resolver]*]
          resolver  ==  cache | file | nis | dns | sys
                    --  default: RESOLV=cache,file,nis,dns,sys
RES_CONF parameter  ==  RES_CONF=URL
                    --  default: RES_CONF="file:/etc/resolv.conf"
                        or from registry (on Windows)
RES_NS parameter    ==  RES_NS=dnsServer[//socksV5Host]
                    --  default: depend on RES_CONF
RES_RR parameter    ==  RES_RR=HostList
                    --  default: RES_RR="*"
RES_VRFY parameter  ==  RES_VRFY=""
                    --  default: none
RES_DEBUG parameter ==  RES_VRFY=number
                    --  default: none
PROTOLIST
       ProtoList  ==  [!]protoSpec[,ProtoList]
       protoSpec  ==  protocolName[/[portNumList][/methodList]]
HOSTLIST
        HostList  ==  [!]hostSpec[,HostList]
        hostSpec  ==  [{userList}@]hostSpec[/netMask]
        userList  ==  userNamePattern[,userNamePattern]*
        hostSpec  ==  hostNamePattern | hostAddrPattern
 userNamePattern  ==  [*]uname[*]
 hostNamePattern  ==  [*]hname[*]
 hostAddrPattern  ==  IPaddressPattern | IPrange
         netMask  ==  IPaddress | maskLength
PARAMETER SUBSTITUTION

CFI AND CFI SCRIPT

PROXYING BY URL REDIRECTION

PROTOCOL SPECIFIC ISSUE AND EXAMPLES

Common Notation

TCPrelay

UDPrelay

Socks server

HTTP proxy/server

HTTP Transfer Log Format

HTTPCONF parameter  ==  what:conf
                    --  default: welcome.dgp,welcome.shtml,welcome.html,...
FILETYPE parameter  ==  suffix:gopherType:altText:iconName:contentType
                    --  default: FILETYPE=".txt:0:TXT:text:text/plain"
                                 FILETYPE=...
CGIENV parameter    ==  CIGENV=name[,name]*
                    --  default: CGIENV="*"
MountOptions for HTTP-DeleGate
AUTH parameters for HTTP-DeleGate

Configuration of DeleGate by Users

Server Side Include in SHTML files

ICP proxy/server

ICPCONF parameter*  ==  ICPCONF={icpMaxima|icpConf}
         icpMaxima  ==  para:N|hitage:N|hitobjage:N|hitobjsize:N|timeout:N
           icpConf  ==  icpOptions:ProtoList:dstHostList:srcHostList
                    --  default: ICPCONF=para:2,hitage:1d,...

FTP proxy/server

FTP Transfer Log Format

Telnet proxy/server

POP proxy

IMAP proxy

SMTP proxy/server

SMTPGATE parameter  ==  SMTPGATE=dirPath
                    --  default: '${ETCDIR}/smtpgate'

NNTP proxy/server

MountOptions for NNTP

NNTPCONF parameter* ==  what:conf
                    --  default: NNTPCONF=upact:600/300/120

LDAP proxy

Whois proxy

X proxy

Gopher proxy

SSL proxy

DNS (Domain Name System) proxy/server

DNSCONF parameter*  ==  what:value

CU-SeeMe proxy

RESERVED NAMES

CUSTOMIZATION

DEFENSE AGAINST ATTACKERS

PLATFORM SPECIFIC ISSUE

GENTLE RESTART

FUNCTIONS

FILES

SEE ALSO

AUTHOR

DISTRIBUTION

Release 6.1.18            Last change: September 5, 2000

--------- --------- --------- --------- --------- --------- --------- ---------