2025-03-14 15:56:27 +03:00
2025-03-14 16:03:18 +03:00
2025-03-11 14:03:10 +03:00
2025-03-12 15:32:44 +03:00
2025-03-12 16:36:18 +03:00
2025-03-13 19:52:10 +03:00
2025-03-14 16:01:22 +03:00

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.

Description
Communicate Client-Server via Windows NamedPipe
Readme MIT 104 KiB
Languages
Python 100%