shsp_types 1.0.0
shsp_types: ^1.0.0 copied to clipboard
Type definitions and serializable models for Single HandShake Protocol (SHSP) - a custom networking protocol for peer-to-peer communication.
SHSP Types #
Type definitions and serializable models for Single HandShake Protocol (SHSP) - a custom networking protocol for peer-to-peer communication.
Features #
- 🔧 Type-safe models for network communication
- 📦 JSON serialization support for all types
- 🌐 IPv4 and IPv6 address support
- ✅ Built-in validation and error handling
- 🚀 Zero dependencies (except for JSON annotations)
Installation #
Add this to your package's pubspec.yaml:
dependencies:
shsp_types: ^1.0.0
Usage #
import 'package:shsp_types/shsp_types.dart';
// Create remote info for peer communication
final rinfo = RemoteInfo(InternetAddress.loopbackIPv4, 8080);
print(rinfo); // 127.0.0.1:8080
// Serialize to JSON
final json = rinfo.toJson();
final restored = RemoteInfo.fromJson(json);
Types Included #
RemoteInfo: Class representing remote address and port informationPeerTypes: Peer identification and metadataStunTypes: STUN protocol integration typesInternetAddressConverter: JSON serialization for IP addresses
Documentation #
For complete documentation, visit pub.dev/packages/shsp_types.
License #
This project is licensed under the MIT License.