www.pudn.com > kRtspProxyd.zip > README


=====

kRtspProxyd  Kernel Rtsp Proxy Daemon

(C) 2003 by Kaiqin Fan ICCC-HUST http://iccc.hust.edu.cn
Licensed under the terms of the GNU General Public License

=====

1. Introduction
---------------
   kRtspProxyd is a kernel rtsp proxy daemon for Linux. 
   kRtspProxyd switch streaming data between servers and clients rather than 
   cache data in local disks, but the next step is obviously to implement 
   this function.
   

2. Quick Start  
--------------

   1) compile and load the module
   2) configure the module in /proc/sys/net/krtsproxyd if needed
   3) echo 1 > /proc/sys/net/krtsproxyd/start

   unloading:
 
   echo 1 > /proc/sys/net/krtsproxyd/stop
   echo 1 > /proc/sys/net/krtsproxyd/unload 
   rmmod krtsproxyd
   


3. Configuration 
----------------
   
   Configuring kRtspProxyd
   ==================

   Before you can start using kRtspProxyd, you have to configure it. This
   is done through the /proc filesystem, and can thus be done from inside
   a script. Most parameters can only be set when kRtspProxyd is not active.

   The following things need configuration:
   
   1) The port where kRtspProxyd should listen for requests
   2) The IP address of the machine that runs the kRtspProxyd

   A typical script (for the first mode of operation) to do this would 
   look like:

#!/bin/sh
insmod krtsproxy.o
echo 192.168.1.63(your IP) > /proc/sys/net/krtsproxyd/serverip
echo 554 > /proc/sys/net/krtsproxyd/serverport
echo 1 > /proc/sys/net/krtsproxyd/start

   
   Stopping kRtspProxyd
   ===============
   In order to change the configuration, you should stop kRtspProxyd by typing
   echo 1 > /proc/sys/net/krtsproxyd/stop
   on a command-prompt.

   If you want to unload the module, you should type
   echo 1 > /proc/sys/net/krtsproxyd/unload
   after stopping krtsproxyd first.

   If this doesn't work fast enough for you (the commands above can wait for 
   a remote connection to close down), you can send the daemons a "HUP"
   signal after you told them to stop. This will cause the daemon-threads to
   stop immediately. 

   Note that the daemons will restart immediately if they are not told to
   stop.

   

4. Permissions
--------------
   The security model of kHTTPd is very strict. It can be, since there is a 
   userspace daemon that can handle the complex exceptions. 

   kHTTPd only serves a file if

	1)  There is no "?" in the URL
	2)  The URL starts with a "/"
	3)  The file indicated by the URL exists
	4)  The file is world-readable (*)
	5)  The file is not a directory, executable or has the Sticky-bit
	    set (*)
	6)  The URL doesn't contain any "forbidden" substrings such as ".."
	    and "cgi-bin" (*)
	7)  The mime-type is known (*)

   The items marked with a (*) are configurable through the
   sysctl-parameters in /proc/sys/net/khttpd.


   In all cases where any of the above conditions isn't met, the
   userspace-daemon is handed the request.



5. Parameters
-------------
   The following parameters are settable through /proc/sys/net/khttpd:
 
	Name		Default		Description

	serverport	8080		The port where kHTTPd listens on

	clientport	80		The port of the userspace
					http-daemon

	threads		2		The number of server-threads. Should
					be 1 per CPU for small websites, 2
					per CPU for big (the active files
					do not fit in the RAM) websites.

	documentroot	/var/www	the directory where the
					document-files are

	start		0		Set to 1 to start kHTTPd 
					(this also resets "stop" to 0)

	stop		0		Set to 1 to stop kHTTPd
					(this also resets "start" to 0)

	unload		0		Set to 1 to prepare kHTTPd for
					unloading of the module

	sloppymime	0		If set to 1, unknown mime-types are
					set to text/html. If set to 0,
					files with unknown mime-types are
					handled by the userspace daemon

	perm_required	S_IROTH		Minimum permissions required
					(for values see "man 2 stat")
	
	perm_forbid	dir+sticky+	Permission-mask with "forbidden"
			execute		permissions.
					(for values see "man 2 stat")

	dynamic		cgi-bin ..	Strings that, if they are a subset
					of the URL, indicate "dynamic
					content"

	maxconnect	1000		Maximum number of concurrent
					connections

6. More information
-------------------
   More information about the architecture of kHTTPd, the mailinglist and
   configuration-examples can be found at the kHTTPd homepage:

	http://www.fenrus.demon.nl

   Bugreports, patches, etc can be send to the mailinglist
   (khttpd-users@zgp.org) or to khttpd@fenrus.demon.nl