- Updated Makefile to include generation of documentation for the entire project. - Expanded the documentation in common/DOC.md to include detailed descriptions of signature types and their recommendations for use. - Added new functions for creating sessions from existing subsessions across various modules (datagram, primary, raw, stream) to streamline session management. - Introduced new session creation functions that allow specifying custom signature types and port configurations for enhanced security and compatibility. - Improved examples and usage notes throughout the documentation to clarify session management and options.
go-sam-go/stream
High-level streaming library for reliable TCP-like connections over I2P using the SAMv3 protocol.
Installation
Install using Go modules with the package path github.com/go-i2p/go-sam-go/stream.
Usage
The package provides TCP-like streaming connections over I2P networks. StreamSession manages the connection lifecycle, StreamListener handles incoming connections, and StreamConn implements the standard net.Conn interface for seamless integration with existing Go networking code.
Create sessions using NewStreamSession, establish listeners with Listen(), and dial outbound connections using Dial() or DialI2P(). The implementation supports context-based timeouts, concurrent operations, and automatic connection management.
Key features include full net.Listener and net.Conn compatibility, I2P address resolution, configurable tunnel parameters, and comprehensive error handling with proper resource cleanup.
Dependencies
- github.com/go-i2p/go-sam-go/common - Core SAM protocol implementation
- github.com/go-i2p/i2pkeys - I2P cryptographic key handling
- github.com/go-i2p/logger - Logging functionality
- github.com/sirupsen/logrus - Structured logging
- github.com/samber/oops - Enhanced error handling