Documentation
¶
Index ¶
- Constants
- Variables
- func DropReqResp(req *http.Request) *http.Response
- func GetSortOrder(items []*models.Record) int
- func NotifyInterceptUpdate(id string, update InterceptUpdate)
- func RegisterInterceptChannel(id string, ch chan InterceptUpdate)
- func RequestDeleteKey(requestData map[string]any, key string)
- func RequestReplace(requestData map[string]any, search string, value string, isRegex bool)
- func RequestUpdateKey(requestData map[string]any, key string, value any)
- func SendHTTP2RawRequest(data RawRequest) (string, string, error)
- func SendHTTPRawRequest(data RawRequest) (string, string, error)
- func SendRawHTTPRequest(host, port string, tls bool, request string, timeout time.Duration, http2 bool) (string, string, error)
- func UnregisterInterceptChannel(id string)
- type Backend
- func (backend *Backend) ActivateTab(e *core.ServeEvent) error
- func (backend *Backend) AddRequest(e *core.ServeEvent) error
- func (backend *Backend) BindFrontend(e *core.ServeEvent) error
- func (backend *Backend) CWDContent(e *core.ServeEvent) error
- func (backend *Backend) ClickProxy(e *core.ServeEvent) error
- func (backend *Backend) CloseTab(e *core.ServeEvent) error
- func (backend *Backend) CommandManager()
- func (backend *Backend) CookApplyMethods(e *core.ServeEvent) error
- func (backend *Backend) CookGenerate(e *core.ServeEvent) error
- func (backend *Backend) CookSearch(e *core.ServeEvent) error
- func (backend *Backend) CreateCollection(collectionName string, dbSchema schema.Schema) error
- func (backend *Backend) DownloadCert(e *core.ServeEvent) error
- func (backend *Backend) ExtractData(host string, fields []string, outputFile string) (string, error)
- func (backend *Backend) ExtractDataEndpoint(e *core.ServeEvent) error
- func (backend *Backend) FileWatcher(e *core.ServeEvent) error
- func (backend *Backend) FiltersCheck(e *core.ServeEvent) error
- func (backend *Backend) GetElementsProxy(e *core.ServeEvent) error
- func (backend *Backend) GetFilePath(folder, fileName string) string
- func (backend *Backend) GetOrCreatePlayground(name string, typeVal string, parentId string) (*models.Record, error)
- func (backend *Backend) GetRecord(collectionName string, filter string) (*models.Record, error)
- func (backend *Backend) GoBack(e *core.ServeEvent) error
- func (backend *Backend) GoForward(e *core.ServeEvent) error
- func (backend *Backend) Info(e *core.ServeEvent) error
- func (backend *Backend) InitializeProxy() error
- func (backend *Backend) InterceptEndpoints(e *core.ServeEvent) error
- func (backend *Backend) IntruderDelete(id string) error
- func (backend *Backend) IntruderNew(id string, data types.PlaygroundItem) error
- func (backend *Backend) LabelAttach(e *core.ServeEvent) error
- func (backend *Backend) LabelDelete(e *core.ServeEvent) error
- func (backend *Backend) LabelNew(e *core.ServeEvent) error
- func (backend *Backend) ListChromeTabs(e *core.ServeEvent) error
- func (backend *Backend) ListProxies(e *core.ServeEvent) error
- func (backend *Backend) ModifyRequest(e *core.ServeEvent) error
- func (backend *Backend) NavigateChromeTab(e *core.ServeEvent) error
- func (backend *Backend) OpenChromeTab(e *core.ServeEvent) error
- func (backend *Backend) PlaygroundAddChild(e *core.ServeEvent) error
- func (backend *Backend) PlaygroundDelete(e *core.ServeEvent) error
- func (backend *Backend) PlaygroundNew(e *core.ServeEvent) error
- func (backend *Backend) ReadFile(e *core.ServeEvent) error
- func (backend *Backend) RegisterProcessInDB(input, data any, name, typz, state string) string
- func (backend *Backend) RegisterXtermRoutes()
- func (backend *Backend) ReloadTab(e *core.ServeEvent) error
- func (backend *Backend) RepeaterDelete(id string) error
- func (backend *Backend) RepeaterNew(id string, data types.PlaygroundItem) error
- func (backend *Backend) RestartProxy(e *core.ServeEvent) error
- func (backend *Backend) RunCommand(e *core.ServeEvent) error
- func (backend *Backend) RunningCommand(id string, command string, filename string)
- func (backend *Backend) RunningCommandSaveToCollection(id, command, collectionName string)
- func (backend *Backend) SaveFile(e *core.ServeEvent) error
- func (backend *Backend) SaveRecordToCollection(collectionName string, data map[string]any) (*models.Record, error)
- func (backend *Backend) SaveRequestToBackend(reqBody types.AddRequestBodyType) (types.UserData, error)
- func (backend *Backend) ScreenshotProxy(e *core.ServeEvent) error
- func (backend *Backend) SearchRegex(e *core.ServeEvent) error
- func (backend *Backend) SendHttpRaw(e *core.ServeEvent) error
- func (backend *Backend) SendRawRequest(e *core.ServeEvent) error
- func (backend *Backend) SendRepeater(e *core.ServeEvent) error
- func (backend *Backend) Serve()
- func (backend *Backend) SetProcess(id, state string)
- func (backend *Backend) SetupCounterManager() error
- func (backend *Backend) SetupFiltersHook() error
- func (backend *Backend) SetupInterceptHooks() error
- func (backend *Backend) SitemapFetch(e *core.ServeEvent) error
- func (backend *Backend) SitemapNew(e *core.ServeEvent) error
- func (backend *Backend) StartProxy(e *core.ServeEvent) error
- func (backend *Backend) StopProxy(e *core.ServeEvent) error
- func (backend *Backend) TemplatesDelete(e *core.ServeEvent) error
- func (backend *Backend) TemplatesList(e *core.ServeEvent) error
- func (backend *Backend) TemplatesNew(e *core.ServeEvent) error
- func (backend *Backend) TextSQL(e *core.ServeEvent) error
- func (backend *Backend) Tools(e *core.ServeEvent) error
- func (backend *Backend) ToolsServer(e *core.ServeEvent) error
- func (backend *Backend) UpdateInterceptFilters(filters string)
- type CountResult
- type Counter
- type CounterManager
- func (cm *CounterManager) Decrement(key, collection, filter string) int64
- func (cm *CounterManager) Delete(key, collection, filter string)
- func (cm *CounterManager) Get(key, collection, filter string) int64
- func (cm *CounterManager) GetAll() map[string]*Counter
- func (cm *CounterManager) GetDetails(key string) (*Counter, bool)
- func (cm *CounterManager) Increment(key, collection, filter string) int64
- func (cm *CounterManager) IncrementWithStartup(key, collection, filter string, loadOnStartup bool) int64
- func (cm *CounterManager) LoadFromDB() error
- func (cm *CounterManager) Reset(key, collection, filter string)
- func (cm *CounterManager) Set(key, collection, filter string, count int64)
- func (cm *CounterManager) SyncOne(key string) error
- func (cm *CounterManager) SyncToDB() error
- type FilterCheckRequest
- type InterceptActionRequest
- type InterceptUpdate
- type ModifyRequestRequest
- type Path
- type ProxyBody
- type ProxyInstance
- type ProxyManager
- func (pm *ProxyManager) AddProxy(id string, proxy *RawProxyWrapper)
- func (pm *ProxyManager) AddProxyInstance(id string, instance *ProxyInstance)
- func (pm *ProxyManager) ApplyToAllProxies(fn func(proxy *RawProxyWrapper, proxyID string))
- func (pm *ProxyManager) ClickElement(proxyID string, url string, selector string, waitForNavigation bool) error
- func (pm *ProxyManager) GetAllProxies() []string
- func (pm *ProxyManager) GetChromeRemote(proxyID string) (*browser.ChromeRemote, error)
- func (pm *ProxyManager) GetElements(proxyID string, url string) ([]browser.ElementInfo, error)
- func (pm *ProxyManager) GetInstance(id string) *ProxyInstance
- func (pm *ProxyManager) GetNextIndex() uint64
- func (pm *ProxyManager) GetNextProxyID() string
- func (pm *ProxyManager) GetProxy(id string) *RawProxyWrapper
- func (pm *ProxyManager) RemoveProxy(id string)
- func (pm *ProxyManager) SetGlobalIndex(value uint64)
- func (pm *ProxyManager) StopAllProxies()
- func (pm *ProxyManager) StopProxy(id string) error
- func (pm *ProxyManager) TakeScreenshot(proxyID string, fullPage bool, savePath string) ([]byte, string, error)
- type ProxyStats
- type RawProxyWrapper
- func (rp *RawProxyWrapper) CleanupTempCaptures() error
- func (rp *RawProxyWrapper) GetCertPath() string
- func (rp *RawProxyWrapper) GetConfig() *rawproxy.Config
- func (rp *RawProxyWrapper) PrintStats()
- func (rp *RawProxyWrapper) RunProxy() error
- func (rp *RawProxyWrapper) SetRequestHandler(handler rawproxy.OnRequestHandler)
- func (rp *RawProxyWrapper) SetResponseHandler(handler rawproxy.OnResponseHandler)
- func (rp *RawProxyWrapper) Stop() error
- type RawRequest
- type RepeaterSendRequest
- type RepeaterSendResponse
- type RequestContext
- type TEXTSQL
- type TemplateInfo
- type ToolsServerResponse
- type XtermManager
- func (m *XtermManager) CleanupAllSessions()
- func (m *XtermManager) CloseSession(sessionID string) error
- func (m *XtermManager) CreateSession(shell, workDir string, envVars map[string]string) (*XtermSession, error)
- func (m *XtermManager) GetSession(sessionID string) (*XtermSession, error)
- func (m *XtermManager) HandleWebSocket(ws *websocket.Conn, sessionID string)
- func (m *XtermManager) ListSessions() []map[string]interface{}
- type XtermMessage
- type XtermResizeData
- type XtermSession
- type XtermStartRequest
- type XtermStartResponse
Constants ¶
const SORT_GAP = 1000
Variables ¶
var ProxyMgr = &ProxyManager{ instances: make(map[string]*ProxyInstance), }
Global proxy manager instance
Functions ¶
func GetSortOrder ¶
func NotifyInterceptUpdate ¶
func NotifyInterceptUpdate(id string, update InterceptUpdate)
NotifyInterceptUpdate sends an update to the waiting goroutine
func RegisterInterceptChannel ¶
func RegisterInterceptChannel(id string, ch chan InterceptUpdate)
RegisterInterceptChannel registers a channel for a specific intercept ID
func RequestDeleteKey ¶
func RequestReplace ¶
func SendHTTP2RawRequest ¶
func SendHTTP2RawRequest(data RawRequest) (string, string, error)
func SendHTTPRawRequest ¶
func SendHTTPRawRequest(data RawRequest) (string, string, error)
func SendRawHTTPRequest ¶
func SendRawHTTPRequest(host, port string, tls bool, request string, timeout time.Duration, http2 bool) (string, string, error)
SendRawHTTPRequest sends a raw HTTP request using the rawhttp client and returns response, time taken, and error
func UnregisterInterceptChannel ¶
func UnregisterInterceptChannel(id string)
UnregisterInterceptChannel removes the channel for a specific intercept ID
Types ¶
type Backend ¶
type Backend struct {
App *pocketbase.PocketBase
Config *config.Config
Cook *cook.CookGenerator
Wappalyzer *wappalyzer.Wappalyze
CmdChannel chan process.RunCommandData
CounterManager *CounterManager
XtermManager *XtermManager
}
func (*Backend) ActivateTab ¶
func (backend *Backend) ActivateTab(e *core.ServeEvent) error
ActivateTab endpoint - switches focus to a specific tab
func (*Backend) AddRequest ¶
func (backend *Backend) AddRequest(e *core.ServeEvent) error
func (*Backend) BindFrontend ¶
func (backend *Backend) BindFrontend(e *core.ServeEvent) error
func (*Backend) CWDContent ¶
func (backend *Backend) CWDContent(e *core.ServeEvent) error
func (*Backend) ClickProxy ¶
func (backend *Backend) ClickProxy(e *core.ServeEvent) error
func (*Backend) CloseTab ¶
func (backend *Backend) CloseTab(e *core.ServeEvent) error
CloseTab endpoint - closes a specific tab
func (*Backend) CookApplyMethods ¶
func (backend *Backend) CookApplyMethods(e *core.ServeEvent) error
func (*Backend) CookGenerate ¶
func (backend *Backend) CookGenerate(e *core.ServeEvent) error
func (*Backend) CookSearch ¶
func (backend *Backend) CookSearch(e *core.ServeEvent) error
func (*Backend) CreateCollection ¶
Create Collection with schema in params
func (*Backend) DownloadCert ¶
func (backend *Backend) DownloadCert(e *core.ServeEvent) error
DownloadCert serves the unified CA certificate (ca.crt) for download Certificate is generated once at app startup, always at the same location
func (*Backend) ExtractData ¶
func (backend *Backend) ExtractData(host string, fields []string, outputFile string) (string, error)
ExtractData extracts specified fields from database records matching the host and saves them to a file. Returns the file path and any error.
func (*Backend) ExtractDataEndpoint ¶
func (backend *Backend) ExtractDataEndpoint(e *core.ServeEvent) error
ExtractDataEndpoint creates an API endpoint for data extraction
func (*Backend) FileWatcher ¶
func (backend *Backend) FileWatcher(e *core.ServeEvent) error
func (*Backend) FiltersCheck ¶
func (backend *Backend) FiltersCheck(e *core.ServeEvent) error
FiltersCheck registers the /api/filter/check endpoint. It evaluates the provided dadql filter against the given columns map.
func (*Backend) GetElementsProxy ¶
func (backend *Backend) GetElementsProxy(e *core.ServeEvent) error
func (*Backend) GetFilePath ¶
func (*Backend) GetOrCreatePlayground ¶
func (*Backend) GoBack ¶
func (backend *Backend) GoBack(e *core.ServeEvent) error
GoBack endpoint - navigates back in browser history
func (*Backend) GoForward ¶
func (backend *Backend) GoForward(e *core.ServeEvent) error
GoForward endpoint - navigates forward in browser history
func (*Backend) InitializeProxy ¶
func (*Backend) InterceptEndpoints ¶
func (backend *Backend) InterceptEndpoints(e *core.ServeEvent) error
InterceptEndpoints registers the HTTP endpoints for intercept management
func (*Backend) IntruderDelete ¶
func (*Backend) IntruderNew ¶
func (backend *Backend) IntruderNew(id string, data types.PlaygroundItem) error
func (*Backend) LabelAttach ¶
func (backend *Backend) LabelAttach(e *core.ServeEvent) error
func (*Backend) LabelDelete ¶
func (backend *Backend) LabelDelete(e *core.ServeEvent) error
func (*Backend) ListChromeTabs ¶
func (backend *Backend) ListChromeTabs(e *core.ServeEvent) error
ListChromeTabs endpoint - lists all open tabs in Chrome
func (*Backend) ListProxies ¶
func (backend *Backend) ListProxies(e *core.ServeEvent) error
func (*Backend) ModifyRequest ¶
func (backend *Backend) ModifyRequest(e *core.ServeEvent) error
func (*Backend) NavigateChromeTab ¶
func (backend *Backend) NavigateChromeTab(e *core.ServeEvent) error
NavigateChromeTab endpoint - navigates a tab to a URL
func (*Backend) OpenChromeTab ¶
func (backend *Backend) OpenChromeTab(e *core.ServeEvent) error
OpenChromeTab endpoint - opens a new tab in Chrome
func (*Backend) PlaygroundAddChild ¶
func (backend *Backend) PlaygroundAddChild(e *core.ServeEvent) error
func (*Backend) PlaygroundDelete ¶
func (backend *Backend) PlaygroundDelete(e *core.ServeEvent) error
func (*Backend) PlaygroundNew ¶
func (backend *Backend) PlaygroundNew(e *core.ServeEvent) error
func (*Backend) RegisterProcessInDB ¶
func (*Backend) RegisterXtermRoutes ¶
func (backend *Backend) RegisterXtermRoutes()
RegisterXtermRoutes registers all xterm-related routes
func (*Backend) ReloadTab ¶
func (backend *Backend) ReloadTab(e *core.ServeEvent) error
ReloadTab endpoint - reloads a specific tab
func (*Backend) RepeaterDelete ¶
func (*Backend) RepeaterNew ¶
func (backend *Backend) RepeaterNew(id string, data types.PlaygroundItem) error
func (*Backend) RestartProxy ¶
func (backend *Backend) RestartProxy(e *core.ServeEvent) error
func (*Backend) RunCommand ¶
func (backend *Backend) RunCommand(e *core.ServeEvent) error
func (*Backend) RunningCommand ¶
func (*Backend) RunningCommandSaveToCollection ¶
func (*Backend) SaveRecordToCollection ¶
func (*Backend) SaveRequestToBackend ¶
func (backend *Backend) SaveRequestToBackend(reqBody types.AddRequestBodyType) (types.UserData, error)
SaveRequestToBackend saves the request and response to the backend database
func (*Backend) ScreenshotProxy ¶
func (backend *Backend) ScreenshotProxy(e *core.ServeEvent) error
func (*Backend) SearchRegex ¶
func (backend *Backend) SearchRegex(e *core.ServeEvent) error
func (*Backend) SendHttpRaw ¶
func (backend *Backend) SendHttpRaw(e *core.ServeEvent) error
func (*Backend) SendRawRequest ¶
func (backend *Backend) SendRawRequest(e *core.ServeEvent) error
func (*Backend) SendRepeater ¶
func (backend *Backend) SendRepeater(e *core.ServeEvent) error
SendRepeater handles the /api/repeater/send endpoint
func (*Backend) SetProcess ¶
func (*Backend) SetupCounterManager ¶
SetupCounterManager initializes the counter manager and loads from database
func (*Backend) SetupFiltersHook ¶
SetupFiltersHook sets up the event hook for filter management Monitors the _ui collection for changes to proxy filters
func (*Backend) SetupInterceptHooks ¶
SetupInterceptHooks sets up the event hook for monitoring intercept state changes
func (*Backend) SitemapFetch ¶
func (backend *Backend) SitemapFetch(e *core.ServeEvent) error
func (*Backend) SitemapNew ¶
func (backend *Backend) SitemapNew(e *core.ServeEvent) error
func (*Backend) StartProxy ¶
func (backend *Backend) StartProxy(e *core.ServeEvent) error
func (*Backend) TemplatesDelete ¶
func (backend *Backend) TemplatesDelete(e *core.ServeEvent) error
func (*Backend) TemplatesList ¶
func (backend *Backend) TemplatesList(e *core.ServeEvent) error
func (*Backend) TemplatesNew ¶
func (backend *Backend) TemplatesNew(e *core.ServeEvent) error
func (*Backend) ToolsServer ¶
func (backend *Backend) ToolsServer(e *core.ServeEvent) error
func (*Backend) UpdateInterceptFilters ¶
UpdateInterceptFilters updates the intercept filters for all proxies
type CountResult ¶
type Counter ¶
type Counter struct {
ID string
Key string // counter_key - the main identifier
Collection string // optional metadata
Filter string // optional metadata
Count atomic.Int64 // Use atomic for lock-free operations
LoadOnStartup bool // if true, recalculate from DB on startup, no immediate sync
// contains filtered or unexported fields
}
Counter represents a counter entry with atomic operations
type CounterManager ¶
type CounterManager struct {
// contains filtered or unexported fields
}
CounterManager manages counters in memory with database sync
func (*CounterManager) Decrement ¶
func (cm *CounterManager) Decrement(key, collection, filter string) int64
Decrement decrements the count for a given counter key (lock-free atomic operation) Parameters: key (counter_key - main identifier), collection (optional - updates metadata), filter (optional - updates metadata) If loadOnStartup=false, syncs immediately to DB for exact counts
func (*CounterManager) Delete ¶
func (cm *CounterManager) Delete(key, collection, filter string)
Delete removes a counter from memory and database Parameters: key (counter_key - main identifier), collection (not used), filter (not used)
func (*CounterManager) Get ¶
func (cm *CounterManager) Get(key, collection, filter string) int64
Get returns the count for a given counter key (lock-free read) Parameters: key (counter_key - main identifier), collection (optional - updates if exists), filter (optional - updates if exists)
func (*CounterManager) GetAll ¶
func (cm *CounterManager) GetAll() map[string]*Counter
GetAll returns all counters (snapshot with current counts)
func (*CounterManager) GetDetails ¶
func (cm *CounterManager) GetDetails(key string) (*Counter, bool)
GetDetails returns the full counter details (key, collection, filter, count) This makes it easy to find all the details: counters["my_key"] gives you everything!
func (*CounterManager) Increment ¶
func (cm *CounterManager) Increment(key, collection, filter string) int64
Increment increments the count for a given counter key (lock-free atomic operation) Parameters: key (counter_key - main identifier), collection (optional - updates metadata), filter (optional - updates metadata) Default: loadOnStartup=false (immediate sync for exact counts)
func (*CounterManager) IncrementWithStartup ¶
func (cm *CounterManager) IncrementWithStartup(key, collection, filter string, loadOnStartup bool) int64
IncrementWithStartup increments with explicit loadOnStartup flag
func (*CounterManager) LoadFromDB ¶
func (cm *CounterManager) LoadFromDB() error
LoadFromDB loads all counters from the database into memory
func (*CounterManager) Reset ¶
func (cm *CounterManager) Reset(key, collection, filter string)
Reset resets a specific counter to 0 (lock-free atomic operation) Parameters: key (counter_key - main identifier), collection (optional - updates metadata), filter (optional - updates metadata)
func (*CounterManager) Set ¶
func (cm *CounterManager) Set(key, collection, filter string, count int64)
Set sets the count for a given counter key Parameters: key (counter_key - main identifier), collection (optional - updates if provided), filter (optional - updates if provided), count
func (*CounterManager) SyncOne ¶
func (cm *CounterManager) SyncOne(key string) error
SyncOne syncs a single counter to database immediately (for load_on_startup=false counters)
func (*CounterManager) SyncToDB ¶
func (cm *CounterManager) SyncToDB() error
SyncToDB syncs only load_on_startup counters to the database (load_on_startup=false counters are synced immediately via SyncOne)
type FilterCheckRequest ¶
type InterceptActionRequest ¶
type InterceptActionRequest struct {
ID string `json:"id"`
Action string `json:"action"` // "forward" or "drop"
IsReqEdited bool `json:"is_req_edited,omitempty"`
IsRespEdited bool `json:"is_resp_edited,omitempty"`
ReqEdited string `json:"req_edited,omitempty"` // Raw HTTP request string
RespEdited string `json:"resp_edited,omitempty"` // Raw HTTP response string
}
InterceptActionRequest represents the request body for intercept actions
type InterceptUpdate ¶
type InterceptUpdate struct {
Action string
IsReqEdited bool
IsRespEdited bool
ReqEditedRaw string // Raw HTTP request string (if edited)
RespEditedRaw string // Raw HTTP response string (if edited)
}
InterceptUpdate represents an update to an intercept request
type ModifyRequestRequest ¶
type ProxyInstance ¶
type ProxyInstance struct {
Proxy *RawProxyWrapper
Browser string // `json:"browser"`
BrowserCmd *exec.Cmd
Label string // `json:"label"`
Chrome *browser.ChromeRemote
}
ProxyInstance holds a proxy and its optional runtime attachments (browser, label, etc.)
type ProxyManager ¶
type ProxyManager struct {
// contains filtered or unexported fields
}
ProxyManager manages multiple proxy instances
func (*ProxyManager) AddProxy ¶
func (pm *ProxyManager) AddProxy(id string, proxy *RawProxyWrapper)
AddProxy adds a proxy to the manager
func (*ProxyManager) AddProxyInstance ¶
func (pm *ProxyManager) AddProxyInstance(id string, instance *ProxyInstance)
AddProxyInstance adds a complete proxy instance to the manager
func (*ProxyManager) ApplyToAllProxies ¶
func (pm *ProxyManager) ApplyToAllProxies(fn func(proxy *RawProxyWrapper, proxyID string))
ApplyToAllProxies applies a function to all running proxies
func (*ProxyManager) ClickElement ¶
func (pm *ProxyManager) ClickElement(proxyID string, url string, selector string, waitForNavigation bool) error
ClickElement clicks an element on the page using the Chrome browser attached to a proxy instance
func (*ProxyManager) GetAllProxies ¶
func (pm *ProxyManager) GetAllProxies() []string
GetAllProxies returns all proxy IDs
func (*ProxyManager) GetChromeRemote ¶
func (pm *ProxyManager) GetChromeRemote(proxyID string) (*browser.ChromeRemote, error)
GetChromeRemote returns a ChromeRemote instance for a proxy, initializing it if necessary
func (*ProxyManager) GetElements ¶
func (pm *ProxyManager) GetElements(proxyID string, url string) ([]browser.ElementInfo, error)
GetElements retrieves information about clickable elements on the page
func (*ProxyManager) GetInstance ¶
func (pm *ProxyManager) GetInstance(id string) *ProxyInstance
GetInstance returns a proxy instance by ID
func (*ProxyManager) GetNextIndex ¶
func (pm *ProxyManager) GetNextIndex() uint64
GetNextIndex returns the next unique index (thread-safe)
func (*ProxyManager) GetNextProxyID ¶
func (pm *ProxyManager) GetNextProxyID() string
GetNextProxyID returns the next unique proxy ID (thread-safe)
func (*ProxyManager) GetProxy ¶
func (pm *ProxyManager) GetProxy(id string) *RawProxyWrapper
GetProxy returns a proxy by ID (listen address)
func (*ProxyManager) RemoveProxy ¶
func (pm *ProxyManager) RemoveProxy(id string)
RemoveProxy removes a proxy from the manager
func (*ProxyManager) SetGlobalIndex ¶
func (pm *ProxyManager) SetGlobalIndex(value uint64)
SetGlobalIndex sets the global index from the database
func (*ProxyManager) StopAllProxies ¶
func (pm *ProxyManager) StopAllProxies()
StopAllProxies stops all running proxies
func (*ProxyManager) StopProxy ¶
func (pm *ProxyManager) StopProxy(id string) error
StopProxy stops a specific proxy
func (*ProxyManager) TakeScreenshot ¶
func (pm *ProxyManager) TakeScreenshot(proxyID string, fullPage bool, savePath string) ([]byte, string, error)
TakeScreenshot captures a screenshot using the Chrome browser attached to a proxy instance Returns: screenshot bytes, file path (if saved), error
type ProxyStats ¶
type ProxyStats struct {
RequestsTotal atomic.Uint64
ResponsesTotal atomic.Uint64
RequestsSaved atomic.Uint64
ResponsesSaved atomic.Uint64
RequestsFailed atomic.Uint64
ResponsesFailed atomic.Uint64
BytesRequest atomic.Uint64
BytesResponse atomic.Uint64
}
ProxyStats tracks proxy statistics
type RawProxyWrapper ¶
type RawProxyWrapper struct {
Intercept bool
Filters string
// contains filtered or unexported fields
}
RawProxyWrapper wraps the rawproxy.Proxy to match our interface
var PROXY *RawProxyWrapper
DEPRECATED: Backward compatibility - returns first proxy or nil
func NewRawProxyWrapper ¶
func NewRawProxyWrapper(listenAddr, configDir, outputDir string, backend *Backend, proxyID string) (*RawProxyWrapper, error)
NewRawProxyWrapper creates a new rawproxy wrapper with the given configuration Set outputDir to empty string ("") to disable file captures
func (*RawProxyWrapper) CleanupTempCaptures ¶
func (rp *RawProxyWrapper) CleanupTempCaptures() error
CleanupTempCaptures removes temporary capture files (if using /tmp) Call this periodically or on shutdown to free up space
func (*RawProxyWrapper) GetCertPath ¶
func (rp *RawProxyWrapper) GetCertPath() string
GetCertPath returns the path to the CA certificate
func (*RawProxyWrapper) GetConfig ¶
func (rp *RawProxyWrapper) GetConfig() *rawproxy.Config
GetConfig returns the proxy configuration
func (*RawProxyWrapper) PrintStats ¶
func (rp *RawProxyWrapper) PrintStats()
PrintStats logs the current proxy statistics
func (*RawProxyWrapper) RunProxy ¶
func (rp *RawProxyWrapper) RunProxy() error
RunProxy starts the proxy server in a non-blocking manner
func (*RawProxyWrapper) SetRequestHandler ¶
func (rp *RawProxyWrapper) SetRequestHandler(handler rawproxy.OnRequestHandler)
SetRequestHandler sets a custom request handler
func (*RawProxyWrapper) SetResponseHandler ¶
func (rp *RawProxyWrapper) SetResponseHandler(handler rawproxy.OnResponseHandler)
SetResponseHandler sets a custom response handler
func (*RawProxyWrapper) Stop ¶
func (rp *RawProxyWrapper) Stop() error
Stop gracefully stops the proxy server
type RawRequest ¶
type RepeaterSendRequest ¶
type RepeaterSendRequest struct {
Host string `json:"host"`
Port string `json:"port"`
TLS bool `json:"tls"`
Request string `json:"request"`
Timeout float64 `json:"timeout"`
HTTP2 bool `json:"http2"`
Index float64 `json:"index"`
Url string `json:"url"`
GeneratedBy string `json:"generated_by"`
Note string `json:"note,omitempty"`
}
type RepeaterSendResponse ¶
type RequestContext ¶
type RequestContext struct {
UserData map[string]any
RawRequest string
RawResponse string // Set in onResponse
RequestStart time.Time
DataRecord *models.Record // Single record shared across all operations
}
RequestContext stores request data for correlation with response This data is passed from onRequest to onResponse via rawproxy.RequestData
type TemplateInfo ¶
type ToolsServerResponse ¶
type XtermManager ¶
type XtermManager struct {
// contains filtered or unexported fields
}
XtermManager manages all terminal sessions
func NewXtermManager ¶
func NewXtermManager() *XtermManager
NewXtermManager creates a new terminal manager
func (*XtermManager) CleanupAllSessions ¶
func (m *XtermManager) CleanupAllSessions()
CleanupAllSessions closes all terminal sessions
func (*XtermManager) CloseSession ¶
func (m *XtermManager) CloseSession(sessionID string) error
CloseSession closes a terminal session
func (*XtermManager) CreateSession ¶
func (m *XtermManager) CreateSession(shell, workDir string, envVars map[string]string) (*XtermSession, error)
CreateSession creates a new terminal session
func (*XtermManager) GetSession ¶
func (m *XtermManager) GetSession(sessionID string) (*XtermSession, error)
GetSession retrieves a session by ID
func (*XtermManager) HandleWebSocket ¶
func (m *XtermManager) HandleWebSocket(ws *websocket.Conn, sessionID string)
HandleWebSocket handles WebSocket connections for terminal I/O
func (*XtermManager) ListSessions ¶
func (m *XtermManager) ListSessions() []map[string]interface{}
ListSessions returns all active sessions
type XtermMessage ¶
type XtermMessage struct {
Type string `json:"type"` // "input", "resize", "ping"
Data interface{} `json:"data"`
}
XtermMessage represents WebSocket messages between client and server
type XtermResizeData ¶
XtermResizeData represents terminal resize data
type XtermSession ¶
type XtermSession struct {
ID string
Cmd *exec.Cmd
Pty *os.File
CreatedAt time.Time
Shell string
WorkDir string
Env []string
// contains filtered or unexported fields
}
XtermSession represents a single terminal session
type XtermStartRequest ¶
type XtermStartRequest struct {
Shell string `json:"shell"` // e.g., "bash", "zsh", "sh", "powershell"
WorkDir string `json:"workdir"` // working directory
Env map[string]string `json:"env"` // additional environment variables
}
XtermStartRequest represents the request to start a new terminal
type XtermStartResponse ¶
type XtermStartResponse struct {
SessionID string `json:"session_id"`
Shell string `json:"shell"`
WorkDir string `json:"workdir"`
}
XtermStartResponse represents the response after starting a terminal
Source Files
¶
- cert.go
- commands.go
- cook.go
- counter.go
- extractor.go
- file.go
- filewatcher.go
- filters.go
- frontend.go
- functions.go
- http.go
- info.go
- intercept.go
- labels.go
- main.go
- modify.go
- playground.go
- proxy.go
- proxy_chrome_phase1.go
- proxy_filters.go
- proxy_rawproxy.go
- proxy_wait.go
- rawhttp.go
- regex.go
- repeater.go
- request.go
- sitemap.go
- sqltest.go
- templates.go
- tools.go
- xterm.go