- Groxy is a powerful and customizable
HTTP/HTTPSproxy written inGo. It is designed to handle both transparent and target-specific proxying, with support for various authentication methods, custom headers,User-Agentrotation,TLScertificate management, dynamic certificate rotation traffic obfuscation, and worker pools for handling concurrent requests. - Groxy is designed to be flexible, allowing you to configure it for different use cases, such as load balancing, traffic monitoring, or secure tunneling.
Transparent Proxy Mode: Automatically forwards requests to the destination host without requiring explicit configuration.Target-Specific Proxy Mode: Directs traffic to a specific target URL.Custom Headers: Add custom headers to outgoing requests.TLS Support: Built-in support forHTTPSwith dynamic certificate generation and rotation.Request/Response Modification: Modify incoming responses and outgoing requests on the fly.Logging: Provides detailed logging for requests, responses, and server events, with support for different log levels (INFO,WARNING,ERROR,DEBUG).Certificate Management: Automatically generate and rotate TLS certificates for secure communication.User-Agent Rotation: RotateUser-Agentstrings to mimic different browsers or devices.HTTP/HTTPS Proxy: Supports bothHTTPandHTTPStraffic with automatic redirection fromHTTPtoHTTPS.Worker Pools: Specify how many workers should be created to handle incoming requests, and determine the buffer size for pending requests.Authentication: Supports multiple authentication methods, including token-based and basic authentication.Traffic Obfuscation: Encrypts and obfuscates traffic to prevent detection and tampering.
- Clone the Repository:
git clone https://github.com/yourusername/Groxy.git
cd Groxy- Build the Project:
go build -o groxy- Run the Proxy:
./groxy -http -https -H "X-Custom-Header: MyValue"Command-Line Options
-t <target>: Specify the target URL for target-specific mode (e.g., http://example.com).-transparent: Run in transparent mode.-H <header>: Add a custom header to outgoing requests (e.g., X-Request-ID: 12345).-http: Enable the HTTP server (listens on port 8080).-https: Enable the HTTPS server (listens on port 8443).-workers: Determine the number of workers. Is set to0by default.queue-size: Detemine the buffer size for pending requests.-timeout: Timeout for requests in seconds. Is set to30seconds by default.-obfuscate: Enable Traffic obfuscation.-redirect: EnableHTTPtoHTTPSredirection.-auth-method: Authentication method to use (none,token, orbasic).-auth-tokens: Comma-separated list of valid tokens (for token-based authentication).-auth-username: Username for basic authentication.-auth-password: Password for basic authentication.
- Transparent mode with
HTTP/HTTPSredirection:
./groxy -transparent -http -https -redirect- Target mode with custom header and worker pool management:
./groxy -t http://example.com -http -workers=10 -queue-size=200 -H "X-Request-ID: 12345"- Target mode with basic authentication and obfuscation:
./groxy -t http://example.com -http -auth-method=basic -auth-username=admin -auth-password=secret -obfuscate- Certificates are stored in the
certsdirectory:certs/server-cert.pem: The server certificate.certs/server-key.pem: The server private key.
- You can replace these files with your own certificates if needed.
- The certificates provided in the repository are for testing purposes.
- Example log entries:
[INFO] Starting HTTP server on port 8080
[INFO] Request: GET http://example.com
[DEBUG] Header: User-Agent: curl/7.68.0
[INFO] Response: 200 OK
[ERROR] Server error: connection refused
- You can use the following logging functions in your code:
logger.Info(format string, v ...interface{}): Logs informational messages.logger.Warning(format string, v ...interface{}): Logs warning messages.logger.Error(format string, v ...interface{}): Logs error messages.logger.Debug(format string, v ...interface{}): Logs debug messages.
proxy/: Contains the core proxy logic, including request/response modification and transparent/target-specific handling.tls/: ManagesTLScertificate generation, rotation, and configuration.servers/: HandlesHTTP/HTTPSserver initialization and management.logger/: Provides logging functionality for requests, responses, and errors.certs/: StoresTLScertificates and keys.auth/: Contains authentication-related code, including token-based and basic authentication.
If you'd like to contribute to Groxy, please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bugfix.
- Submit a pull request with a detailed description of your changes.