Documentation
¶
Index ¶
- Variables
- func SendHttpResponse(conn net.Conn, statusCode int, msg string, args ...any)
- type Manager
- func (m *Manager) Acquire(subdomain string) (transport.Stream, error)
- func (m *Manager) ForEachClient(fn func(subdomain string, info *connection.Connection))
- func (m *Manager) HandleConnection(transp transport.Transport)
- func (r *Manager) HandleHTTPConnection(conn net.Conn)
- func (m *Manager) HandleStream(client *connection.Connection, msg *protocol.Message) error
- func (m *Manager) HandleStreamDude(stream transport.Stream)
- func (m *Manager) IsAuthorized(token string) bool
- func (m *Manager) Release(subdomain string, stream transport.Stream)
- func (m *Manager) SetGunnelSubdomainHandler(handler http.HandlerFunc)
- func (m *Manager) SetTokenValidator(validator func(string) bool)
- type ResponseWriterWrapper
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNoConnection = errors.New("no connection available") ErrSubdomainNotFound = errors.New("subdomain not found") )
Functions ¶
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager handles routing of connections between clients and local services.
func (*Manager) ForEachClient ¶
func (m *Manager) ForEachClient(fn func(subdomain string, info *connection.Connection))
ForEachClient iterates over all clients and calls the provided function for each one.
func (*Manager) HandleConnection ¶
HandleConnection handles a new connection.
func (*Manager) HandleHTTPConnection ¶
HandleHTTPConnection handles an HTTP connection.
func (*Manager) HandleStream ¶
func (m *Manager) HandleStream(client *connection.Connection, msg *protocol.Message) error
func (*Manager) HandleStreamDude ¶
func (*Manager) IsAuthorized ¶
IsAuthorized evaluates the provided token using the installed validator. When no validator is configured, it returns true (allow).
func (*Manager) SetGunnelSubdomainHandler ¶
func (m *Manager) SetGunnelSubdomainHandler(handler http.HandlerFunc)
func (*Manager) SetTokenValidator ¶
SetTokenValidator defines a callback used to authorize client registration tokens. If not set, all registrations are allowed.
type ResponseWriterWrapper ¶
type ResponseWriterWrapper struct {
// contains filtered or unexported fields
}
func NewResponseWriterWrapper ¶
func NewResponseWriterWrapper(conn net.Conn) *ResponseWriterWrapper
func (*ResponseWriterWrapper) Flush ¶
func (rw *ResponseWriterWrapper) Flush()
func (*ResponseWriterWrapper) Header ¶
func (rw *ResponseWriterWrapper) Header() http.Header
func (*ResponseWriterWrapper) Write ¶
func (rw *ResponseWriterWrapper) Write(data []byte) (int, error)
func (*ResponseWriterWrapper) WriteHeader ¶
func (rw *ResponseWriterWrapper) WriteHeader(statusCode int)
Click to show internal directories.
Click to hide internal directories.