5.1 Rules Configuration

Version 3.0.0 and never

General form of the proxies.xml confguration file:

			<proxies>
			
				<serviceProxy >*
			
				<proxy >*
			
			</proxies>
		
Listing 12: proxies.xml Configuration

Configuration Example

The following example shows a proxies.xml file. It contains a serviceProxy rule and a proxy rule.

			<proxies>
				<serviceProxy port="80">
					<basicAuthentication>
						<user name="alice" password="membrane" />
					</basicAuthentication>
					<target host="www.thomas-bayer.com" port="80" />
				</serviceProxy>

				<proxy name="HTTP Proxy" port="3128" />
			</proxies>
	   
Listing 12: Example proxies.xml file

Service proxies are used as reverse proxies while proxy rules configures HTTP proxies. The example shows the usage of interceptors. In the serviceProxy the basicAuthentication interceptor is used to secure the page www.thomas-bayer.com with HTTP Basic Authentication. With interceptors you can manipulate how the messages are processed. Take a look at all available interceptors here. A listing of all configuration elements that can be used in the proxies.xml can be found here.

Versions before 3.0.0

General form of the XML confguration file:

       
<configuration>
	<rules>
		<!-- Forwarding Rules -->
		<!-- Proxy Rules -->
	</rules> 
	<global><!-- Global Features --> </global>
</configuration>
		
Listing 3: Rule Configuration File

1. Reverse Proxy Rules

Simple reverse proxy rule definition:

       
		<forwarding-rule name="my-reverse-rule" port="2000">
			<targetport>80</targetport>
			<targethost>www.thomas-bayer.com</targethost>
			<interceptors>
				<interceptor id="someInterceptor"/>
			</interceptors>
		</forwarding-rule>
		
Listing 4: Forwarding Rule Configuration

2. Proxy Rules

       
<!-- Startup an HTTP proxy on port 3128. -->
<proxy-rule name="HTTP Proxy" port="3128" />
		
Listing 5: Proxy Rule Configuration