Skip to main content

Communicate Client-Server via Windows NamedPipe.

Project description

winConnect

Communicate Client-Server via Windows NamedPipe

ToDo:

  • Add support for sending and receiving data (0.1.0)
  • Add support for safe closing (0.9.0)
  • Add support for other header settings (0.9.0)
  • Add logging (0.9.1)
  • Send data in chunks (if data is too large) (0.9.3)
  • Add support for encryption (0.9.2)
    • simple (via char xor'ing; auto-pairing) (0.9.2)
    • password (via AES and PBKDF2) (0.9.3)
    • certificate (via RSA)
  • Add support for multiple clients

Description

This is a simple client-server communication system for Windows. The client and server communicate via a named pipe. The client sends a message to the server, and the server responds with a message. The client and server can be run on the same machine or on different machines.

Installation

To install the package, use the following command:

pip install winConnect

Usage

You can find examples in the examples directory.

Server

The server is a daemon that listens for incoming messages from clients. The server can be run on the same machine as the client or on a different machine. To run the server, use the following command:

from winConnect import WinConnectDaemon

connector = WinConnectDaemon('test')  # test - name of the pipe

for data in connector.listen():
    print(f"({type(data)}) {data=}")
    if data is None and connector.closed:
        break
    connector.send_data(data)

Client

The client sends a message to the server and waits for a response. To run the client, use the following command:

from winConnect import WinConnectClient

connector = WinConnectClient('test')

with connector as conn:
    while True:
        i = input(":> ")
        if i == "exit": break
        conn.send_data(i)
        print(conn.read_pipe())

License

This project is licensed under the MIT License - see the LICENSE file for details.

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

winconnect-0.9.3.tar.gz (10.3 kB view details)

Uploaded Source

Built Distribution

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

winconnect-0.9.3-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

File details

Details for the file winconnect-0.9.3.tar.gz.

File metadata

  • Download URL: winconnect-0.9.3.tar.gz
  • Upload date:
  • Size: 10.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for winconnect-0.9.3.tar.gz
Algorithm Hash digest
SHA256 5fb836b04b33e89f87190d2a27fb9850ee4a802956e0c93a2cbe6c6338ca5b89
MD5 994a6d2e3fe00d9b8efe0dc20f1c112f
BLAKE2b-256 c7a54261ba074ec62824ccc8e9ddcc0602ce0f66af2d3c47ced22481f931a02a

See more details on using hashes here.

File details

Details for the file winconnect-0.9.3-py3-none-any.whl.

File metadata

  • Download URL: winconnect-0.9.3-py3-none-any.whl
  • Upload date:
  • Size: 10.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for winconnect-0.9.3-py3-none-any.whl
Algorithm Hash digest
SHA256 ab7f2a446c5d090f4dfdbb0fe35fbe46e77e8ec20ac683b33f46d020ec259a8d
MD5 2a6cfcdd75832fb2facebb9bc887b517
BLAKE2b-256 03e567da009cba67ff8c81573edcca27f4a4ecccd815c4a38d3fa59146702633

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