Skip to main content

ZapNet ⚡

License: MIT Python Version PyPI Version

中文 | English

ZapNet is a high-performance network diagnostics toolkit with Multi-Protocol Support, including TCP and UDP.

Key Features

  • 🚀 Dual Protocol Engine: TCP full-duplex / UDP broadcast
  • 📊 Traffic Analytics: Real-time connection monitoring
  • 🔧 Smart Config: YAML-driven test scenarios
  • 💾 Data Archiving: Raw packet capture (ASCII/Hex)
  • 🌍 Cross-Platform: Windows/macOS/Linux support

Installation

# For production use
pip install zapnet

# Development setup
git clone https://github.com/luhuadong/zapnet.git
cd zapnet && pip install -e .[dev]

Quick Start

TCP Server/Client

# Start TCP server
zapnet tcp server --port 5555

# Start TCP client
zapnet tcp client --host 127.0.0.1 --port 5555 --data "Hello, World"
# Send hexadecimal content
zapnet tcp client --host 127.0.0.1 --port 5555 --hex "A1B2C3D4"
# Another form to fill in target IP and port
zapnet tcp client --target 127.0.0.1:5555 --hex "A1B2C3D4"

UDP Server/Client

# Start UDP server
zapnet udp server --port 6666

# Start UDP client
zapnet udp client --host 127.0.0.1 --port 6666 --data "Hello, World"
# Send hexadecimal content
zapnet udp client --host 127.0.0.1 --port 6666 --hex "A1B2C3D4"
# Another form to fill in target IP and port
zapnet udp client --target 127.0.0.1:6666 --hex "A1B2C3D4"

Device Discovery (UDP Broadcast)

# Send probe broadcast
zapnet udp client --target 192.168.1.255:9999 --broadcast --hex "A1B2C3D4"

# Monitor responses
zapnet udp server --port 9999 --filter "hex_contains(payload, 'C3D4')" --output devices.log

Network Sniffing (UDP)

# Capture DNS queries
zapnet udp server --port 53 --hex --stats 5

# Send custom DNS query
zapnet udp client --target 8.8.8.8:53 --hex "b362010000010000000000000377777706676f6f676c6503636f6d0000010001"

TCP Stress Testing

# Start TCP server
zapnet tcp server --port 9000 --max-conn 50 --timeout 300

# Simulate high concurrency
zapnet tcp client --host 127.0.0.1 --port 9000 --threads 10 --duration 60 --message "LOAD_TEST"

File Transfer

# Send file (TCP)
zapnet tcp client --host 192.168.1.100 --port 8888 --file data.zip

# Receive files
zapnet tcp server --port 8888 --output received_files/

Advanced Configuration

You can set default parameters through ZapNet's configuration file config.yaml, for example:

network:
  tcp:
    buffer_size: 4096
    keepalive: true
  udp:
    broadcast_ttl: 64

logging:
  level: debug
  rotation: 100MB

security:
  allowed_ips: ["192.168.1.0/24"]

Launch with:

zapnet --config config.yaml

License

Distributed under the MIT License. See LICENSE for more information.

Metadata

Release files for zapnet 0.1.1

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

Source distribution (sdist)

Source distribution for zapnet 0.1.1
File Size Uploaded
zapnet-0.1.1.tar.gz 9.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for zapnet 0.1.1
File Interpreter ABI Platform
zapnet-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 19.9 kB

Release files / zapnet-0.1.1.tar.gz

Download URL zapnet-0.1.1.tar.gz
Size 9.2 kB
Tags Source
SHA-256 checksum
How to use checksums
ba846b9024f79d10db8ba8d745768df16773bc484e820a11f6bc8a867edde38a
BLAKE2b-256 checksum
How to use checksums
2ffd85df4ab1ca70c6d6260cd7095f5401f0ed1f58584c65e2cc1c08ca3ba2a6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.8.10

Release files / zapnet-0.1.1-py3-none-any.whl

Download URL zapnet-0.1.1-py3-none-any.whl
Size 10.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1977aa3c959f7d975fd408cbfdd617489ea5173f6fdd675f136efbc96fe9a9cb
BLAKE2b-256 checksum
How to use checksums
d4b2b037bfccefb3279d5f3c59f9edbcc2ef30edfa70fde4ef37ebdb3a59ff6c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.8.10

Release history Release notifications | RSS feed

This release

0.1.1 This release

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