MUDitM

MUD in the Middle Telnet SSL Proxy

MUDitM is a telnet proxy that provides an IPv6 and telnet-ssl frontend to standard IPv4/telnet Multi-User Dungeon type games that have not implemented those networking features yet, whatever the reason. The implementation differs from other secure proxy implementations in that it tries to report the proxied client address up to the game server via the NEW-ENVIRON / MNES standard.

The latest version is MUDitM-0.4.tgz.

                        MUDitM - MUD in the Middle Proxy

                ******* This is the MUDitM-0.4 release! *******
                        Thu 03 Aug 2023 12:36:31 AM EDT

MUDitM is a telnet proxy that I wrote on a whim over a long weekend.  My intent
was to try to provide an IPv6 and telnet-ssl front end to standard IPv4/telnet
Multi-User Dungeon type games that have not implemented those networking
features yet, whatever the reason.  MUDitM-0.2 had another weekend's worth of
polish on it, and has has served as the ssl frontend for the Last Outpost MUD
for two years.

Version 0.3 changes the scnprintf() calls for glib's compatible g_snprintf()
implementation, removing the need for an included scnprintf implementation.  It
also fixes a bug with non-ssl encrypted setups.

MUDitM's implementation differs from other secure proxy implementations in that
it tries to report the proxied client address up to the game server via the
NEW-ENVIRON / MNES standard.  (See https://tintin.mudhalla.net/protocols/mnes/
for docs on MNES.)  I went for that method because my MUD already understands
it.

MUDitM uses PCRE2 as its back end pattern matching engine, it allows
configuration of multiple ip address reporting variables, and I added the
stunnel PROXY announcement as an option for games that already support that.


Compilation, Installation
-------------------------

It'll compile and run on Ubuntu 20.10 and compatible systems.  You'll need to
install gcc, gnumake, libglib2.0-dev, ctags, pcre2 and openssl.

See INSTALL file for the barest of documentation.  As of version 0.2, there is
an install option in the makefile.

Installing it on Windows or Mac?  Le'me know how that goes.

What I've learned from this project:
------------------------------------

    1) At least for my mud, throwing an SSL socket directly into the game
    server itself using openssl wouldn't have been as involved as I thought it
    might be.  This proxy came together pretty quickly.

    2) There is a another ssl proxy project out there called `stunnel`
    (https://www.stunnel.org/) that I had looked at briefly, but did not try
    out because I didn't realize that it had its own way of sending the remote
    networking address info through the proxy.  It does, it is very
    straightforward, and that style of reporting would be pretty trivial to add
    to a mud server that doesn't already do NEW-ENVIRON. So, I added that PROXY
    reporting method to MUDitM for the sake of compatibility.

    3) PCRE2 looks kind of daunting from the documentation.  Its not.

Bugs, Limitations, Todos
------------------------

MCCP2 and MCCP3 are de-negotiated by MUDitM, because it doesn't understand zlib
compression.  Maybe someday it will.

You've got to be careful with adding patterns via pcre2.  Don't include sub
match expressions, or you are going to screw up my 'what just matched'
algorithm.  (see also: "ret-2" buried somewhere in proxy.c.)

I did a crummy job of handling write(). They aren't queued properly at all for
partial or zero writes.  Of course, with over two years of runtime front-ending
my game, it hasn't been an issue in production, so perhaps not so crummy after
all.

The IPADDRESS injection from MUDitM happens as soon as the server makes a
request for the full environment set.  If the client is also going to export
IPADDRESS, MUDitM does nothing to prevent that, and the client's export will
update the value seen on the game.  This is both good and bad- it is good,
because it lets a chain of proxies forward the first IPADDRESS along
unmolested.  It's bad in that it lets the client control the value of
IPADDRESS.  If you want to have access to the address that MUDitM is connected to
on the other side, export it using a different, less likely to be overwritten
variable name.  This is an area that could use improvement.

Contributing, Bug Reporting, Support
------------------------------------

You can contact the author (see the AUTHORS file) with your questions, bug
reports, or patches! The most up to date .tar.gz version of MUDitM can be found
at:

https://last-outpost.com/LO/pubcode

There is no "sourceforge" or "github" or "gitlab" or "slack" or "google code"
or "public svn" or other "open source repository" for this project. 

If you found MUDitM on one of those kind of repos, you can safely assume that
is a fork, and it has nothing to do with me, the original author.  I probably
won't be looking at the fork, so don't get mad when I don't respond to things
that have been posted to wherever that is.



Releases

PLAY NOW