mirror of
https://github.com/Gouryella/drip.git
synced 2026-02-24 05:10:43 +00:00
enhancements - Add adaptive HTTP response handling with automatic streaming for large responses (>1MB) - Implement zero-copy streaming using buffer pools for better performance - Add compression module for reduced bandwidth usage - Add GitHub Container Registry workflow for automated Docker builds - Add production-optimized Dockerfile and docker-compose configuration - Simplify background mode with -d flag and improved daemon management - Update documentation with new command syntax and deployment guides - Clean up unused code and improve error handling - Fix lipgloss style usage (remove unnecessary .Copy() calls)
46 lines
1.4 KiB
Go
46 lines
1.4 KiB
Go
package constants
|
|
|
|
import "time"
|
|
|
|
const (
|
|
// DefaultServerPort is the default port for the tunnel server
|
|
DefaultServerPort = 8080
|
|
|
|
// DefaultWSPort is the default WebSocket port
|
|
DefaultWSPort = 8080
|
|
|
|
// HeartbeatInterval is how often clients send heartbeat messages
|
|
HeartbeatInterval = 5 * time.Second
|
|
|
|
// HeartbeatTimeout is how long the server waits before considering a connection dead
|
|
HeartbeatTimeout = 15 * time.Second
|
|
|
|
// RequestTimeout is the maximum time to wait for a response from the client
|
|
RequestTimeout = 30 * time.Second
|
|
|
|
// ReconnectBaseDelay is the initial delay for reconnection attempts
|
|
ReconnectBaseDelay = 1 * time.Second
|
|
|
|
// ReconnectMaxDelay is the maximum delay between reconnection attempts
|
|
ReconnectMaxDelay = 60 * time.Second
|
|
|
|
// MaxReconnectAttempts is the maximum number of reconnection attempts (0 = infinite)
|
|
MaxReconnectAttempts = 0
|
|
|
|
// DefaultTCPPortMin/Max define the default allocation range for TCP tunnels
|
|
DefaultTCPPortMin = 20000
|
|
DefaultTCPPortMax = 40000
|
|
// DefaultDomain is the default domain for tunnels
|
|
DefaultDomain = "tunnel.localhost"
|
|
)
|
|
|
|
// Error codes
|
|
const (
|
|
ErrCodeTunnelNotFound = "TUNNEL_NOT_FOUND"
|
|
ErrCodeTimeout = "TIMEOUT"
|
|
ErrCodeConnectionFailed = "CONNECTION_FAILED"
|
|
ErrCodeInvalidRequest = "INVALID_REQUEST"
|
|
ErrCodeAuthFailed = "AUTH_FAILED"
|
|
ErrCodeRateLimited = "RATE_LIMITED"
|
|
)
|