Skip to main content

Miniboa: a simple Telnet server

build status downloads

What?

Miniboa is a bare-bones Telnet server to use as the base for a MUD or similar interactive server. Miniboa has several nice features for this type of application.

Features

  • Asynchronous - no waiting on player input or state.

  • Single threaded - light on resources with excellent performance.

  • Runs under your game loop - you decide when to poll for data.

  • Supports 1000 users under Linux and 512 under Windows (untested).

  • Miniboa is compatible with both Python 2.7, and 3.x

Quick Start

First:

pip install miniboa

And then:

from miniboa import TelnetServer
server = TelnetServer()
while True: server.poll()

But you probably want to do something with the connecting/disconnecting clients:

clients = []


def on_connect(client):
    client.send("Hello, my friend. Stay awhile and listen.")
    clients.append(client)


def on_disconnect(client):
    clients.remove(client)


server = TelnetServer(
    port=3333,
    address='',
    on_connect=on_connect,
    on_disconnect=on_disconnect
    encoding='utf-8')

while True:
    server.poll()

To use Miniboa, you create a Telnet Server object listening at a specified port number. You have to provide two functions for the server; the first is a handler for new connections and the second is the handler for lost connections. These handler functions are passed Telnet Client objects – these are your communication paths to and from the individual player’s MUD client.

For example, let’s say Mike and Joe connect to your MUD server. Telnet Server will call your on_connect() function with Mike’s Telnet Client object, and then again with Joe’s Telnet Client object. If Mike’s power goes out, Telnet Server will call your on_disconnect() function with Mike’s Telnet Client object (same exact one).

This will launch a server listening on the default port, that accepts Telnet connections and sends a simple message.

$ telnet localhost 7777
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Hello, my friend. Stay awhile and listen.

Further documentation can be found here.

Metadata

Release files for miniboa 1.0.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for miniboa 1.0.9
File Size Uploaded
miniboa-1.0.9.tar.gz 17.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for miniboa 1.0.9
File Interpreter ABI Platform
miniboa-1.0.9-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 33.3 kB

Release files / miniboa-1.0.9.tar.gz

Download URL miniboa-1.0.9.tar.gz
Size 17.0 kB
Tags Source
SHA-256 checksum
How to use checksums
a2111d8bd045d714b8e89e5ea658c274793b539f6ade8ed4b9b1914a7086029d
BLAKE2b-256 checksum
How to use checksums
792e7cd8eb254de1764c26c9d5d1eb6a06a6eed027263c3d412278f1e92fb6c2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.6

Release files / miniboa-1.0.9-py2.py3-none-any.whl

Download URL miniboa-1.0.9-py2.py3-none-any.whl
Size 16.2 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
236942ea7fb939a9880ef9a606967928ce2f803823682eece83f74cd0a8cbaaf
BLAKE2b-256 checksum
How to use checksums
91fbb5e9240d25147c0c72022210e602356d84b14ed62a5c87c14ac69ea311fb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.6

Release history Release notifications | RSS feed

This release

1.0.9 This release

2 release files

1.0.8

1 release file

1.0.7

1 release file

1.0.6

1 release file

1.0.5

1 release file

1.0.4

1 release file

1.0.3

1 release file

1.0.2

1 release file

1.0.1

1.0.0

0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page