Documentation
¶
Index ¶
- Variables
- func GenerateFunnelID(remoteTarget string, localTarget string) string
- type CaptureRequest
- type CaptureRequestResponse
- type CaptureResponse
- type ClientRequestDetails
- type DisplayFunnel
- type Funnel
- type FunnelIdAndRest
- type FunnelRegistry
- type HTTPFunnel
- type HTTPFunnelOptions
- type HeaderEntry
- type HttpServer
- type ProxyRequestMsg
- type QueryParamEntry
- type RequestList
- type RequestListNode
- type RequestResponse
- type TailscaleClient
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidFunnelPath = errors.New("invalid path format for funnel request") ErrFunnelNotFound = errors.New("funnel not found") ErrFunnelNotReady = errors.New("funnel has no local target configured") ErrTargetURLParse = errors.New("failed to parse funnel target URL") )
Error variables for common failure modes
View Source
var HttpServerPath = fmt.Sprintf("/%s/", util.ProgramName)
Functions ¶
func GenerateFunnelID ¶
Types ¶
type CaptureRequest ¶
type CaptureRequestResponse ¶
type CaptureRequestResponse struct {
ID string
FunnelID string
Timestamp time.Time
Request CaptureRequest
Response CaptureResponse
Duration time.Duration
}
func (*CaptureRequestResponse) Method ¶
func (r *CaptureRequestResponse) Method() string
func (*CaptureRequestResponse) Path ¶
func (r *CaptureRequestResponse) Path() string
func (*CaptureRequestResponse) RoundedDuration ¶ added in v0.0.2
func (r *CaptureRequestResponse) RoundedDuration() string
func (*CaptureRequestResponse) StatusCode ¶
func (r *CaptureRequestResponse) StatusCode() int
func (*CaptureRequestResponse) Type ¶ added in v0.0.2
func (r *CaptureRequestResponse) Type() string
func (*CaptureRequestResponse) URL ¶
func (r *CaptureRequestResponse) URL() string
type CaptureResponse ¶
type ClientRequestDetails ¶ added in v0.0.2
type ClientRequestDetails struct {
FunnelID string
UUID string
Path string
Method string
Status int
Duration string
Time string
ClientIP string
RequestHeaders []HeaderEntry
ResponseHeaders []HeaderEntry
RequestBody string
ResponseBody string
QueryParams []QueryParamEntry
}
ClientRequestDetails is the structure passed to the _request_detail_content.html template.
type DisplayFunnel ¶ added in v0.0.2
DisplayFunnel is used for displaying funnel information in the inspector.
type Funnel ¶
type Funnel struct {
HTTPFunnel *HTTPFunnel
Client *TailscaleClient
Requests *RequestList
}
func CreateEphemeralFunnel ¶
func (*Funnel) LocalTarget ¶
LocalTarget returns the local URL that traffic is ultimately proxied to.
func (*Funnel) RemoteTarget ¶
RemoteTarget returns the public URL exposed by the Tailscale funnel.
type FunnelIdAndRest ¶
type FunnelIdAndRest struct {
// contains filtered or unexported fields
}
FunnelIdAndRest holds the extracted funnel ID and the rest of the path.
type FunnelRegistry ¶
func NewFunnelRegistry ¶
func NewFunnelRegistry() *FunnelRegistry
func (*FunnelRegistry) AddFunnel ¶
func (f *FunnelRegistry) AddFunnel(funnel Funnel)
func (*FunnelRegistry) RemoveFunnel ¶
func (f *FunnelRegistry) RemoveFunnel(id string)
type HTTPFunnel ¶
type HTTPFunnel struct {
// contains filtered or unexported fields
}
type HTTPFunnelOptions ¶
type HTTPFunnelOptions struct {
ID string // id of the funnel
LocalPort uint16 // local port to use
RemotePort uint16 // remote port to tunnel to use. one of 443, 8443, 10000
HTTPS bool // local server uses TLS
Insecure bool // ignore TLS certificate errors for local server
// Mount string // mount point for the local server, almost always "/" unless you want to serve a subdirectory
Inspect bool // hijack to local tsgrok server
}
HTTPFunnelOptions holds configuration for creating an HTTP funnel.
type HeaderEntry ¶ added in v0.0.2
HeaderEntry is used for displaying request/response headers.
type HttpServer ¶
type HttpServer struct {
// contains filtered or unexported fields
}
func NewHttpServer ¶
func NewHttpServer(port int, messageBus util.MessageBus, funnelRegistry *FunnelRegistry, logger *stdlog.Logger) (*HttpServer, error)
func (*HttpServer) GetFunnelById ¶
func (s *HttpServer) GetFunnelById(id string) (Funnel, error)
func (*HttpServer) Start ¶
func (s *HttpServer) Start() error
type ProxyRequestMsg ¶
type ProxyRequestMsg struct {
FunnelId string
}
type QueryParamEntry ¶ added in v0.0.2
QueryParamEntry is used for displaying URL query parameters.
type RequestList ¶
type RequestList struct {
Head *RequestListNode
Tail *RequestListNode
Length int
// contains filtered or unexported fields
}
func (*RequestList) Add ¶
func (r *RequestList) Add(request CaptureRequestResponse)
type RequestListNode ¶
type RequestListNode struct {
Request CaptureRequestResponse
Next *RequestListNode
Prev *RequestListNode
}
type RequestResponse ¶
type RequestResponse struct {
Request CaptureRequest
Response CaptureResponse
Duration time.Duration
}
type TailscaleClient ¶
type TailscaleClient struct {
// contains filtered or unexported fields
}
func (*TailscaleClient) CreateHTTPFunnel ¶
func (c *TailscaleClient) CreateHTTPFunnel(opts HTTPFunnelOptions) (HTTPFunnel, error)
func (*TailscaleClient) Logout ¶
func (c *TailscaleClient) Logout() error
func (*TailscaleClient) UpdateStatus ¶
func (c *TailscaleClient) UpdateStatus() (*ipnstate.Status, error)
Click to show internal directories.
Click to hide internal directories.