Skip to main content

Python generic TCP/UDP server implementation, with configurable request-response modules (e.g, 'ok', 'reflect', 'json').

Project description

Generic-Server

Python generic TCP/UDP server implementation, with configurable request-response modules (e.g, 'ok', 'reflect', 'json').

Status: Beta
Authors: Carsten König

Purpose

Sometimes you need a TCP or UDP server that answers with a specific strings to a given request. For testing different network components in a lab environment, some components in the network might not be available. In order to simulate their presence, Generic-Server answers TCP or UDP string requests using modules either with pre-defined responses or simulated behaviour.

Installation

pip install generic-server

How to use

In order to start a Generic-Server, start the server with the desired config:

genericserver <protocol> <port> <responder>

protocol: either TCP or UDP
port: port to listen on
responder: one out of 'ok', 'reflect', 'manual' or 'json'

    ok: Always sends 'ok' as an answer.
    reflect: Reflects the request string back to the sender.
    manual: Prompts the user to manually enter an answer.
    json: Get answers from a json document. For nested json, a delimiter can be chosen (default ':').
    Example:

    {"test": {
            "a": "1",
            "b": 2
            }
    }
    

    Request: test:a
    Response: 1

License

GNU GPLv3 License

Author

Carsten König

Project details


Download files

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

Source Distribution

generic-server-1.1.3.tar.gz (20.5 kB view details)

Uploaded Source

Built Distribution

generic_server-1.1.3-py3-none-any.whl (24.2 kB view details)

Uploaded Python 3

File details

Details for the file generic-server-1.1.3.tar.gz.

File metadata

  • Download URL: generic-server-1.1.3.tar.gz
  • Upload date:
  • Size: 20.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.8

File hashes

Hashes for generic-server-1.1.3.tar.gz
Algorithm Hash digest
SHA256 89469a79bcd36fbb34099d95427eb58ab81d9f3458941cc2cc055b979e6d5b1d
MD5 e9e8aeee5493496cae8cc5b019756622
BLAKE2b-256 50befdc29b68e5c61166db7a16d2ff768cca54f03023ec1cde2101446ae1853b

See more details on using hashes here.

File details

Details for the file generic_server-1.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for generic_server-1.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 1dcc4d38afd1bd278c1fc6a619f1c9f6111e9c9056daed3bd4551ef9d2269f3d
MD5 b92e91165aebc4b6b159c767400abb6c
BLAKE2b-256 a108111b81e3c28979b94a71474ac78395e2cadb7ec9875d7a7edfa8ca51f658

See more details on using hashes here.

Supported by

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