Educational Project Notice: This is an educational project created to demonstrate and learn how Go interacts with shared memory across different operating systems. The implementation serves as a learning resource for understanding cross-platform shared memory management and network programming in Go.
A high-performance, multi-circuit Tor network client implementation in Go with cross-platform shared memory support.
H278 is a sophisticated network client that enables concurrent HTTP requests through multiple Tor circuits while maintaining cross-platform compatibility for shared memory operations. The application is designed to handle high-throughput network requests with IP rotation capabilities and comprehensive logging.
This project was created to:
- Demonstrate shared memory implementation in Go
- Show cross-platform compatibility approaches
- Illustrate system-level programming concepts
- Provide practical examples of Go's syscall interfaces
- Showcase proper error handling and resource management
- Multiple concurrent Tor circuits management
- Cross-platform shared memory implementation (Windows/Unix)
- Automatic IP rotation
- Request queuing and processing
- Comprehensive logging and monitoring
- Graceful shutdown handling
- Go 1.23.2 or higher
- Tor service installed and accessible in system PATH
- For Unix/Linux:
sudo apt-get install tor(Debian/Ubuntu) - For Windows: Download and install from the official Tor website
- Verify installation with
tor --versionin terminal/command prompt
- For Unix/Linux:
- Compatible with Windows and Unix-based systems
- MultiTorClient: Manages multiple Tor circuits
- TorCircuit: Individual Tor circuit implementation
- Request: HTTP request abstraction
- Platform-specific shared memory implementations
- Unified interface through SharedMemoryInterface
- Separate implementations for Windows and Unix systems
- ResponseLogger: Handles request logging and monitoring
- Manages client lifecycle and request processing
The application implements a cross-platform shared memory system:
- Unix Implementation: Uses POSIX shared memory (shm_open)
- Windows Implementation: Uses Windows memory-mapped files
- Abstract interface ensuring consistent behavior across platforms
require (
github.com/cretz/bine v0.2.0
golang.org/x/net v0.31.0
golang.org/x/sys v0.27.0
golang.org/x/crypto v0.29.0
)sharedMemName := "h278" // Shared memory identifier
sharedMemSize := 1024*1024 // 1MB size- Default request interval: 5 seconds
- Random delay between requests: 600-800ms
- Circuit count: 4 (configurable)
package main
import (
"H278/service"
"log"
)
func main() {
logger, err := service.NewResponseLogger(
"your-target-url",
"h278", // Shared memory name
1024*1024, // Shared memory size
)
if err != nil {
log.Fatal(err)
}
defer logger.Stop()
logger.Start()
// ... handle shutdown
}request := network.Request{
URL: targetURL,
Method: "POST",
Body: jsonBody,
Headers: map[string]string{
"Connection": "keep-alive",
"User-Agent": "H278",
"Content-Type": "application/json",
},
}The application includes comprehensive test suites:
- Circuit initialization
- IP rotation
- Request processing
- Error handling
- Tor connection validation
- IP rotation verification
- Response timing tests
Run tests using:
go test ./tests/...- All requests are routed through Tor circuits
- Automatic IP rotation for anonymity
- Configurable request delays to prevent detection
- Secure shared memory implementation
- Proper cleanup on shutdown
- Memory access permissions handling
- Circuit initialization failures
- Network request errors
- Shared memory errors
- Graceful cleanup on failures
- Concurrent circuit management
- Configurable delay between requests
- Memory-efficient shared data handling
- Automatic resource cleanup
- Requires local Tor service installation
- Memory size limited by system constraints
- Network performance dependent on Tor network
- Adjust shared memory size based on requirements
- Configure appropriate request delays
- Set reasonable circuit count
- Monitor response times
- Track IP rotation success
- Log error patterns
- Regular Tor service updates
- Monitor memory usage
- Review log patterns
- Fork the repository
- Create feature branch
- Implement changes
- Add/update tests
- Submit pull request
This project is released under a permissive educational license:
Permission is hereby granted, free of charge, to any person obtaining a copy of this software, to use, copy, modify, and distribute this software and its documentation for educational purposes, subject to the following conditions:
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
- The software is provided "as is", without warranty of any kind, express or implied.
- This software may be used freely for educational and learning purposes.
- Commercial use requires separate licensing.
This tool is intended for educational purposes only. The primary goal is to demonstrate shared memory concepts and Go programming techniques. Users are responsible for compliance with applicable laws and regulations regarding network access and data collection.