Skip to main content

kn-sock

PyPI version

A simplified socket programming toolkit for Python that makes network communication easy and efficient.

Features

  • TCP/UDP Messaging: Supports both synchronous and asynchronous communication
  • Secure Communication: SSL/TLS support for encrypted connections
  • JSON Socket Communication: Easily send and receive JSON data over sockets
  • File Transfer: Transfer files between clients and servers with progress tracking
  • Live Streaming: Multi-video streaming with adaptive bitrate
  • Video Chat: Real-time multi-client video chat with voice
  • WebSocket Support: Full WebSocket server and client implementation
  • HTTP/HTTPS: Simple HTTP client and server helpers
  • Pub/Sub & RPC: Publish/subscribe messaging and remote procedure calls
  • Message Queuing: Advanced queue management for reliable message delivery
  • Load Balancing: Distribute connections across multiple servers
  • Data Compression: Built-in compression for bandwidth optimization
  • Protocol Buffers: Support for efficient binary serialization
  • Decorators & Utilities: Helper decorators and utility functions
  • Docker Support: Ready-to-use Docker containers and compose files
  • Interactive CLI: Real-time interactive command-line interface
  • Command-Line Interface: Simple CLI for quick socket operations
  • Connection Pooling: Efficient connection reuse for high-performance applications
  • Network Visibility: ARP scanning, MAC lookup, and DNS monitoring tools

Installation

pip install kn-sock

Quick Start

Here's a simple example to get you started:

# Server
from kn_sock import start_tcp_server

def handle_message(data, addr, client_socket):
    print(f"Received from {addr}: {data.decode('utf-8')}")
    client_socket.sendall(b"Message received!")

start_tcp_server(8080, handle_message)
# Client
from kn_sock import send_tcp_message

send_tcp_message("localhost", 8080, "Hello, World!")

Docker Quick Start

# Run with Docker Compose
docker-compose run knsock --help

# Run tests
docker-compose run test

For detailed Docker usage, see the Docker guide.

What's Next?

Protocol Documentation

Advanced Features

Reference & Examples

Network Visibility Tools

⚠️ ETHICAL WARNING: These tools are intended for use in authorized networks such as schools, labs, or controlled IT environments. Monitoring user traffic may be illegal without explicit consent. Use responsibly and ethically.

Network Monitoring

Metadata

Release files for kn-sock 0.3.0

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

Source distribution (sdist)

Source distribution for kn-sock 0.3.0
File Size Uploaded
kn_sock-0.3.0.tar.gz 61.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for kn-sock 0.3.0
File Interpreter ABI Platform
kn_sock-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 114.9 kB

Release files / kn_sock-0.3.0.tar.gz

Download URL kn_sock-0.3.0.tar.gz
Size 61.1 kB
Tags Source
SHA-256 checksum
How to use checksums
6369521fd514dd59515b2fcc1c19e7dd28f277033c9dbc0ffa2a405e7c5691f9
BLAKE2b-256 checksum
How to use checksums
7708aefbdf4f461da8ca88600c968a49b89779acc58b9f112dcda8c6e4dc80df
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.13

Release files / kn_sock-0.3.0-py3-none-any.whl

Download URL kn_sock-0.3.0-py3-none-any.whl
Size 53.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6f10406fe06dc8090c9ac46bbb8a9865b56e72ce4b9d9e8c96b6118092f60b72
BLAKE2b-256 checksum
How to use checksums
eaa85d03a71563a77c574ec49b0cc8ef7cc201e7443f7e0e2ea362e38b483a25
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.13

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

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