Skip to main content

The RCON-Fake library allows you to accept user commands using the RCON protocol.

Project description

RCON-Fake

The RCON-Fake library allows you to accept user commands using the RCON protocol.

Description

The RCON-Fake library emulates the operation of the RCON server (Remote Console), providing the ability to receive commands from clients, process them using a custom handler, and send responses. The program also supports password authentication.

The library can be useful for testing applications running with RCON, or emulating a remote server.

Technical requirements

  • Python versions 3.x.

Installation

  1. Make sure that you have Python version 3.x installed.

  2. Install the library using pip:

    pip3 install rcon-fake
    

Usage

1. Importing the library

from rcon_fake import RCON

2. Creating a custom handler

User Handler:

  • Accepts the only argument, the user's command.
  • Returns a string with the answer either None.

Implementation example:

def handler(payload):
    print(f"Command received: {payload}")
    return f"Response: {payload}"

3. Initializing the server

When creating a server instance, you can set the following parameters:

  • host is the IP address where the server will be running (default: "0.0.0.0" — all interfaces).
  • port is the port for incoming connections (by default: 19132).
  • password is the password for authentication (default: None, authentication is disabled).

Example:

rcon = RCON(host="0.0.0.0", port=19132, password="12345678")

4. Assigning a custom handler

rcon.set_handler(handler)

5. Starting the server

When start() is called, the server starts in a separate thread by default (threading=True).

rcon.start(True)

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rcon_fake-0.1.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rcon_fake-0.1-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

Details for the file rcon_fake-0.1.tar.gz.

File metadata

  • Download URL: rcon_fake-0.1.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.1

File hashes

Hashes for rcon_fake-0.1.tar.gz
Algorithm Hash digest
SHA256 3e6de43e205b790875ac417ab61ef2693cde05626a87a803a94113979de8982a
MD5 7e45e9df43c4ed0c375865f7d3cb141c
BLAKE2b-256 e1dc9f004e375632e857e52d5614c0c5b32205268d54698a249bada47f4cc999

See more details on using hashes here.

File details

Details for the file rcon_fake-0.1-py3-none-any.whl.

File metadata

  • Download URL: rcon_fake-0.1-py3-none-any.whl
  • Upload date:
  • Size: 3.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.1

File hashes

Hashes for rcon_fake-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5a3dee71c5a519b094b671def79cd0010aaf0a37ce4fa0f0a53c5581d1ffc8c4
MD5 4d6246a88c7bb1791eba7502a2fcb081
BLAKE2b-256 99d05257b1ff3d1e29b261cc3418c9ac5abbed92b55222879643ca5e5d18a383

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page