Skip to content
diegows edited this page Nov 30, 2012 · 5 revisions

Wanproxy configuration is driven by a single file. This file defines instances that maps TCP ports of the applications that you want to accelerate. Right now, this is the only tested way to configure Wanproxy, but this will change in the near future (pcap, socks support).

Wanproxy requires two instances, running on each side of the link that you want to optimize. We call client to the instance running in the remote site (for example, a branch) and server to the instance running in the datacenters or in the the side where the high speed connection to the applications exists. The configuration of both sides are similar, we show first the configuration of the client side.

The configuration has four sections:

create codec codec0 # (1)
set codec0.codec XCodec # 
set codec0.cache COSS # 
set codec0.cache_path "/var/lib/wanproxy" # 
set codec0.local_size 300 # 
set codec0.remote_size 300 # 
set codec0.compressor zlib # 
set codec0.compressor_level 9 # 
activate codec0

create interface if0 # (2)
set if0.family IPv4
set if0.host "127.0.0.1"
set if0.port "3300"
set if0.proto TCP # 
activate if0

create peer peer0 # (3)
set peer0.family IPv4
set peer0.host "wanproxy-server.example.com"
set peer0.port "3301"
set peer0.proto TCP_POOL 
activate peer0

create proxy proxy0 # (4)
set proxy0.interface if0
set proxy0.interface_codec None
set proxy0.peer peer0
set proxy0.peer_codec codec0
activate proxy0
  1. This creates the section that defines the codec used to transfer data between Wanproxies on both side of the link. Here you configure the type of codec, wanproxy cache, path, and gzip compression level. local_size defines the size of the cache to store blocks that are transferred to the Wanproxy peer. remote_size is the size of the cache used to store blocks received from the peer.
  2. This create an interface, an address and port where Wanproxy will listen for connections. proto can be TCP or TCP_POOL. For Wanproxy clients, it must be TCP.
  3. This defines the peer where Wanproxy connects to. proto can be TCP or TCP_POOL. It should be set to TCP_POOL for Wanproxy client.
  4. This create a proxy instance, a map between the interface and the remote peer. The codec is only defined in the peer, obviously.

This is the configuration of the server, there are only a few differences:

create codec codec0
set codec0.codec XCodec 
set codec0.cache COSS
set codec0.cache_path "/var/lib/wanproxy"
set codec0.local_size 300
set codec0.remote_size 300
set codec0.compressor zlib
set codec0.compressor_level 9
activate codec0

create interface if0
set if0.family IPv4
set if0.host "0.0.0.-"
set if0.port "3301"
set if0.proto TCP_POOL # (1)
activate if0

create peer peer0
set peer0.family IPv4
set peer0.host "webapp.example.com"
set peer0.port "80"
set peer0.proto TCP # (2)
activate peer0

create proxy proxy0
set proxy0.interface if0
set proxy0.interface_codec codec0 # (3)
set proxy0.peer peer0
set proxy0.peer_codec None # (4)
activate proxy0

The differences are:

  1. The interface defines proto TCP_POOL, it's method method that the client use to connect to the server.
  2. The connection to the peer, the real web application, has proto TCP.
  3. The codec of the interface if codec0 instead of None.
  4. The codec to the peer is None.

About cache size

The size of the cache is defined by two variables. The local cache and remote cache. The first one defines the size of the cache to storage objects that are transmited to the peer. The second one is the size of the cache to store blocks received from the peer.

In Wanproxy clients, both values should be the same. In servers that has several clients connected, the local size should be remote size * number of clients. The remote size should be the size of the cache in the peers.

Clone this wiki locally