Documentation
¶
Index ¶
- func ClientIP(r *http.Request, trustProxy bool) string
- func NewLogger() *slog.Logger
- type Config
- type Limits
- type Registry
- func (r *Registry) AssignSubdomain(requested, clientIP string) (string, error)
- func (r *Registry) CleanupExpiredHolds()
- func (r *Registry) GetBySubdomain(subdomain string) (*Tunnel, bool)
- func (r *Registry) IsAvailable(subdomain string) bool
- func (r *Registry) IsAvailableFor(subdomain, clientIP string) bool
- func (r *Registry) Register(t *Tunnel) error
- func (r *Registry) RegisterWithIPLimit(t *Tunnel, maxPerIP int) error
- func (r *Registry) Unregister(subdomain string)
- type Server
- type Tunnel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
PublicTunnelDomain string
TunnelEndpointHost string
ServerPort string
MaxBodyBytes int64
RequestTimeoutSeconds int
MaxConcurrentRequestsPerTunnel int
MaxTunnelsPerIP int
MaxRegistrationsPerIPPerMinute int
MaxPublicRequestsPerIPPerMinute int
SubdomainHoldSeconds int
PublicURLScheme string
TrustProxyHeaders bool
BlockedIPs map[string]struct{}
}
func LoadConfig ¶
func LoadConfig() Config
type Limits ¶
type Limits struct {
// contains filtered or unexported fields
}
func (*Limits) AllowPublicRequest ¶
func (*Limits) AllowRegistrationRate ¶
func (*Limits) IsIPBlocked ¶
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
func NewRegistry ¶
func (*Registry) AssignSubdomain ¶
func (*Registry) CleanupExpiredHolds ¶
func (r *Registry) CleanupExpiredHolds()
func (*Registry) GetBySubdomain ¶
func (*Registry) IsAvailable ¶
func (*Registry) IsAvailableFor ¶
func (*Registry) RegisterWithIPLimit ¶
func (*Registry) Unregister ¶
Click to show internal directories.
Click to hide internal directories.