Previous Next Up FAQ Table of Contents

8.3.2 Using Remote Ad Servers

You can use the BannerPlayer applet and the ProxyServlet (both of which are included with VolanoChat) to display advertisement banners from remote Web servers directly in each chat room. You can even display banners from remote ad servers such as LinkExchange, the Flycast Network, and DoubleClick. This chapter shows you how, with examples from each of these ad servers. You should be able to use the same techniques described below with any other cookie-based ad server or network.

To see banner advertisements being displayed live from the LinkExchange network in VolanoChat rooms, simply enter a chat room in Volano's demonstration server.

Note: If the Web address you specify for the banner image src parameter or the link href parameter contains an ampersand ("&") or equal sign ("="), make sure to replace them with their hexadecimal representation for the proxy servlet. The hexadecimal encoding is shown below:
Character  Encoding
   &         %26
   =         %3D

For example, if the link you normally use looks like this:

http://www.domain.com/view.asp?site=1777&ref=116610&b=2

you should change the link to the following when using it as a parameter for the proxy servlet:

http://www.domain.com/view.asp?site%3D1777%26ref%3D116610%26b%3D2

LinkExchange

Volano's LinkExchange HTML banner advertisement looks like:



and is coded using the following HTML (obtained from the LinkExchange Control Center's Get HTML button):

<!-- BEGIN LINKEXCHANGE CODE -->
<center>

<iframe src="http://leader.linkexchange.com/1/X540954/showiframe?"
 width=468 height=60 marginwidth=0 marginheight=0
 hspace=0 vspace=0 frameborder=0 scrolling=no>
<a href="http://leader.linkexchange.com/1/X540954/clickle" target="_top">
<img src="images/http://leader.linkexchange.com/1/X540954/showle?"
 width=468 height=60 border=0 ismap alt="">
</a>
</iframe>
<br>

<a href="http://leader.linkexchange.com/1/X540954/clicklogo" target="_top">
<img src="images/http://leader.linkexchange.com/1/X540954/showlogo?"
 width=468 height=16 border=0 ismap alt="">
</a>
<br>

</center>
<!-- END LINKEXCHANGE CODE -->

Keep in mind that this HTML code uses Volano's LinkExchange identifier of X540954 in the image source and link addresses. Your HTML code would use your own LinkExchange ID instead of Volano's.

In all this HTML mess, there are just two pieces that are important for displaying the banner image, the bar image below it, and their two links. The 468-by-60-pixel banner image and its link are:

banner src  = http://leader.linkexchange.com/1/X540954/showle?
banner href = http://leader.linkexchange.com/1/X540954/clickle

The 468-by-16-pixel bar image (which displays the LinkExchange name below the banner) and its link are defined by:

bar src  = http://leader.linkexchange.com/1/X540954/showlogo?
bar href = http://leader.linkexchange.com/1/X540954/clicklogo

To define the same images and links to the BannerPlayer applet, simply modify the BannerPlayer.txt file found by default in the VolanoChat applet's code base to specify (with the banner.1 and bar.image specifications all on one line):

# BannerPlayer Applet Parameters
background=#FFFFFF
foreground=#000000
banner.width=468
banner.height=60
banner.cache=true
banner.ismap=true
banner.char=$
banner.1=0 http://www.domain.com:8080/servlet/proxy?src=http://leader.linkexchange.com/$/X540954/showle? http://www.domain.com:8080/servlet/proxy?href=http://leader.linkexchange.com/$/X540954/clickle
bar.width=468
bar.height=16
bar.cache=true
bar.ismap=true
bar.char=
bar.image=0 http://www.domain.com:8080/servlet/proxy?src=http://leader.linkexchange.com/1/X540954/showlogo? http://www.domain.com:8080/servlet/proxy?href=http://leader.linkexchange.com/1/X540954/clicklogo

where www.domain.com is the host name of the machine running your VolanoChat server with its embedded Java servlet runner on port 8080. Please see the [7.4] BannerPlayer Applet section for details on each of its properties.

In defining the BannerPlayer applet properties, note the following:

Flycast Network

The HTML code for the Flycast Network is a bit more complicated than that of LinkExchange because it wraps JavaScript around the image (img) and anchor (a) tags in addition to using an iframe tag. Ignoring the JavaScript code and the iframe, you'll find in the middle of the Flycast HTML something like:

<a href="http://adex3.flycast.com/server/socket/127.0.0.1:2800/click/Volano/123"
 target=_top>
<img src="images/http://adex3.flycast.com/server/socket/127.0.0.1:2800/img/Volano/123"
 border=0 width=468 height=60>
</a>

The image and its link could then be defined to the BannerPlayer applet by the following properties (with the banner.1 specification all on one line):

background=#FFFFFF
foreground=#000000
banner.width=468
banner.height=60
banner.cache=true
banner.ismap=false
banner.char=$
banner.1=0 http://www.domain.com:8080/servlet/proxy?src=http://adex3.flycast.com/server/socket/127.0.0.1:2800/img/Volano/$ http://www.domain.com:8080/servlet/proxy?href=http://adex3.flycast.com/server/socket/127.0.0.1:2800/click/Volano/$

where www.domain.com is the host name of the machine running your VolanoChat server with its embedded Java servlet runner on port 8080.

DoubleClick

In a similar manner, you can find an image source address and its corresponding link in the DoubleClick HTML tags:

<a href="http://ad.doubleclick.net/jump/www.volano.com/volano;num=10001?">
<img src="images/http://ad.doubleclick.net/ad/www.volano.com/volano;num=10001?"
 width="468" height="60">
</a>

The image and its link could then be defined to the BannerPlayer applet by the following properties (with the banner.1 specification all on one line):

background=#FFFFFF
foreground=#000000
banner.width=468
banner.height=60
banner.cache=true
banner.ismap=false
banner.char=$
banner.1=0 http://www.domain.com:8080/servlet/proxy?src=http://ad.doubleclick.net/ad/www.volano.com/volano;num=$? http://www.domain.com:8080/servlet/proxy?href=http://ad.doubleclick.net/jump/www.volano.com/volano;num=$?

where www.domain.com is the host name of the machine running your VolanoChat server with its embedded Java servlet runner on port 8080.

Note: The ProxyServlet adds the following HTTP request headers to all HTTP GET requests going to the remote Web server:
X-Forwarded-For: aaa.bbb.ccc.ddd
Client-IP: aaa.bbb.ccc.ddd

These headers indicate the actual requesting client's IP address, and are required by some ad server software and services when the request is sent through a proxy.


Previous Next Up FAQ XHTML 1.0 Table of Contents

2014-07-11 — An updated version of the VOLANO chat server that supports the latest Java 8 Plug-in is now available. More…

The VOLANO® chat software for the Java™ platform lets you build on-line communities and add real-time social networking to your Web site. More…

John Neffenger <john@status6.com>
More…

A PROJECT OF STATUS:6®