
Readme for bproxy-0.1:
----------------------

bproxy is a tool for people using Linux firewalls/gateways with
masquerading to allow them to play Blizzard games through battle.net. 
It currently has some problems (see BUGS) and is quite Linux specific,
so portability is right out.   This archive includes 2 programs --
bproxy, which is probably buggier, but allows both creation and
joining of games, and bsimple, while only allows joining of existing
games, but has been tested more. Please mail any
comments/problems/fixes to sammy@users.qual.net, as it's not been
extensively tested, but it seems to work for me.

Requirements:
-------------

bproxy/bsimple require the following Linux kernel options --

	IP Masquerading (you are likely already using this)
	Transparent proxy support (in Networking Options)

Your kernel must be recent enough to support both of these, most 2.0
and 2.1 kernels should be fine.

Configuration:
--------------

Before you compile, you will need to edit bproxy.c/bsimple.c
(whichever you intend to use).  As we're not able to monitor the
battle.net protocol, the proxy needs to be informed as to which
internal systems may potentially need to recieve connections from the
outside.  

Near the top of each file is a line which reads:
char *remotes[] = {"10.0.0.3", "10.0.0.30", NULL};

This line must contain a list of all of the windows machines behind
the firewall which might want to use battle.net.  For example, if you
had 2 systems inside the firewall with IP addresses 192.168.1.3 and
192.168.1.55, your line would look like:

char *remotes[] = {"192.168.1.3", "192.168.1.55", NULL};

This list must end with a NULL as the final item.

Also, if you'd like debugging messages, each file has a line which
reads:

#undef DEBUG

slightly below the remotes line.  Changing this to:

#define DEBUG

will produce lots of debugging information.


Compiling:
----------

To compile bproxy and bsimple, just type "make".  They both compile
cleanly for me under Linux 2.1.129 and glibc 2.0.7 (redhat 5.1).  Your
milage may vary.  

Running:
--------

Once the kernel is properly configured and installed on the
firewall/router/gateway machine, simply run bproxy/bsimple on that
machine with the only argument being the port to listen on (this
should almost always be 6112).  You can find a way to include this in
your startup scripts which pleases you.

BUGS:
-----

bproxy/bsimple is not an elegant pile of code by any means, but, hey,
it gets the job done for me.   The basic problem boils down to the
fact that when a connection comes in, we don't actually know it's
destination.   For this reason, we've got to keep a list of systems
which might be the intended recepient, and try each one in turn until
we get an acknowledgement.  Not exactly pretty.  

1) Multiple internal systems creating games:

	If 2 or more internal systems were to create games at the same
	time, problems would likely ensue, based on the possibility
	that more than one host may be willing to acknowledge an
	incoming connection.  I'm not actually sure of what will
	happen, it depends on the battle.net protocol (about which we
	know virtually nothing).

2) Sane connection closing:

	In this version, I've been having some trouble getting the
	proxy to correctly acknowledge when an incoming connection
	closes.  Sometimes it works, and, well, sometimes we're less
	fortunate, and we get a stuck connection hanging around.  I
	haven't actually seen any highly detrimental effects of this
	yet, but it does consume memory, and also some other kernel
	resources.  However, they seem to close most of the time for
	me. :)  If you're having a problem, feel free to try to fix
 	it.

Copying:
--------

bproxy is Copyright 1998 Sam Creasey, and is distributed under the
terms of the GNU Public Licence (v2 or greater).  Please see the file
COPYING included in this archive for details.



	-- Sam Creasey <sammy@users.qual.net>
	   11/24/98

