This Request Agent is used by the WebServer to determine whether a web request should be redirected and to actually redirect the request by returning the proper redirect code to the client.
If an HTTPRedirectAgent is running and the WebServer's redirect_agent prop is the same as the HTTPRedirectAgent's service_name, the agent will redirect requests for URLs in the http.redirect file. This file lists where to redirect to; URIs with multiple redirects listed in the file will be cycled between the listed redirects, providing a round-robin load distribution scheme.
The file format is name/value pairs delimited by newlines; lines starting with '#' are ignored. Complete URLs must be used to specify redirected URLs and the redirect targets. Here is an example of a redirect file:
http://myserver/redir1/file.htm=http://yahoo.com/ http://myserver/redir2/=http://redirect1:9000/ http://myserver/redir2/==http://redirect2:9000/ http://myserver/redir2/==http://redirect3:9000/When a browser requests /redir1/file.html, it is redirected to http://yahoo.com. When it requests /redir2, it is redirected to http://redirect1:9000/. The next request for /redir2 is redirected to http://redirect2:9000/. The third incoming request is redirected to http://redirect3:9000/. The fourth request is redirected to http://redirect1:9000/, and the cycle is started again. In this way, the HTTPRedirectAgent can be used for round-robin style load balancing.
There are 2 kinds of name/value pairs used in the redirect configuration file. The first is a direct mapping in the format NAME=VALUE. This mapping tells the redirect agent to redirect PATH NAME to PATH VALUE.
A directly mapped NAME that contains a hostname must have a host in its VALUE. A direct mapping will not recurse subdirectories in a path and each path is regarded as literal. Directly mapped names can by mapped to multiple values if the values are separated by commas. The agent will cycle through each of the different paths given as the value.
The second kind of mapping maps only hosts to hosts, and passes the requested URL along with the redirected request for the mapped host to handle. This is an example of host-to-host mapping syntax:
http://myhost.com>http://www.myhost.comNo path information is included in the syntax of this mapping, only the host names. Any path intended for myhost.com will be mapped to the host www.myhost.com.
Note: Cyclical references in the redirect mappings are not checked, if the redirect file has cyclical references, clients can be put into an infinite loop of redirects.
For a list of all members of this type, see HTTPRedirectAgent Members .
System.Object
Props
Agent
ServiceAgent
RequestAgent
HTTPRedirectAgent
Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.
Namespace: com.neokernel.httpd
Assembly: Neokernel (in Neokernel.exe)
HTTPRedirectAgent Members | com.neokernel.httpd Namespace