traffic

package
v0.0.0-...-d5c29ae Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 15, 2026 License: AGPL-3.0 Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CaptureMode_name = map[int32]string{
		0: "CAPTURE_MODE_UNSPECIFIED",
		1: "CAPTURE_MODE_RELAY",
		2: "CAPTURE_MODE_RECORD",
	}
	CaptureMode_value = map[string]int32{
		"CAPTURE_MODE_UNSPECIFIED": 0,
		"CAPTURE_MODE_RELAY":       1,
		"CAPTURE_MODE_RECORD":      2,
	}
)

Enum value maps for CaptureMode.

View Source
var (
	RoutingMode_name = map[int32]string{
		0: "ROUTING_MODE_UNSPECIFIED",
		1: "ROUTING_MODE_DIRECT",
		2: "ROUTING_MODE_PROXY",
		3: "ROUTING_MODE_SUBSCRIBE",
		4: "ROUTING_MODE_AUTO",
		5: "ROUTING_MODE_SWITCH",
		6: "ROUTING_MODE_CLEAR",
	}
	RoutingMode_value = map[string]int32{
		"ROUTING_MODE_UNSPECIFIED": 0,
		"ROUTING_MODE_DIRECT":      1,
		"ROUTING_MODE_PROXY":       2,
		"ROUTING_MODE_SUBSCRIBE":   3,
		"ROUTING_MODE_AUTO":        4,
		"ROUTING_MODE_SWITCH":      5,
		"ROUTING_MODE_CLEAR":       6,
	}
)

Enum value maps for RoutingMode.

View Source
var File_aop_traffic_protocol_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type CaptureConfig

type CaptureConfig struct {
	Mode         CaptureMode `protobuf:"varint,1,opt,name=mode,proto3,enum=aop.traffic.CaptureMode" json:"mode,omitempty"`
	DecryptHttps bool        `protobuf:"varint,2,opt,name=decrypt_https,json=decryptHttps,proto3" json:"decrypt_https,omitempty"` // intercept CONNECT to MITM-decrypt HTTPS
	Filter       *FlowFilter `protobuf:"bytes,3,opt,name=filter,proto3" json:"filter,omitempty"`                                  // record only matching flows
	// contains filtered or unexported fields
}

CaptureConfig sets the hub's capture behaviour. It flips the runtime record flag; the listener address never changes so in-flight children are unaffected.

func (*CaptureConfig) Descriptor deprecated

func (*CaptureConfig) Descriptor() ([]byte, []int)

Deprecated: Use CaptureConfig.ProtoReflect.Descriptor instead.

func (*CaptureConfig) GetDecryptHttps

func (x *CaptureConfig) GetDecryptHttps() bool

func (*CaptureConfig) GetFilter

func (x *CaptureConfig) GetFilter() *FlowFilter

func (*CaptureConfig) GetMode

func (x *CaptureConfig) GetMode() CaptureMode

func (*CaptureConfig) ProtoMessage

func (*CaptureConfig) ProtoMessage()

func (*CaptureConfig) ProtoReflect

func (x *CaptureConfig) ProtoReflect() protoreflect.Message

func (*CaptureConfig) Reset

func (x *CaptureConfig) Reset()

func (*CaptureConfig) String

func (x *CaptureConfig) String() string

type CaptureMode

type CaptureMode int32

CaptureMode selects what the hub does with traffic it routes. RELAY forwards undecrypted and records nothing; RECORD intercepts (MITM) and stores flows.

const (
	CaptureMode_CAPTURE_MODE_UNSPECIFIED CaptureMode = 0 // leave capture unchanged (Configure)
	CaptureMode_CAPTURE_MODE_RELAY       CaptureMode = 1 // route only: no interception, no record
	CaptureMode_CAPTURE_MODE_RECORD      CaptureMode = 2 // intercept + record
)

func (CaptureMode) Descriptor

func (CaptureMode) Enum

func (x CaptureMode) Enum() *CaptureMode

func (CaptureMode) EnumDescriptor deprecated

func (CaptureMode) EnumDescriptor() ([]byte, []int)

Deprecated: Use CaptureMode.Descriptor instead.

func (CaptureMode) Number

func (x CaptureMode) Number() protoreflect.EnumNumber

func (CaptureMode) String

func (x CaptureMode) String() string

func (CaptureMode) Type

type CaptureState

type CaptureState struct {
	Mode      CaptureMode `protobuf:"varint,1,opt,name=mode,proto3,enum=aop.traffic.CaptureMode" json:"mode,omitempty"`
	Capturing bool        `protobuf:"varint,2,opt,name=capturing,proto3" json:"capturing,omitempty"`
	// contains filtered or unexported fields
}

func (*CaptureState) Descriptor deprecated

func (*CaptureState) Descriptor() ([]byte, []int)

Deprecated: Use CaptureState.ProtoReflect.Descriptor instead.

func (*CaptureState) GetCapturing

func (x *CaptureState) GetCapturing() bool

func (*CaptureState) GetMode

func (x *CaptureState) GetMode() CaptureMode

func (*CaptureState) ProtoMessage

func (*CaptureState) ProtoMessage()

func (*CaptureState) ProtoReflect

func (x *CaptureState) ProtoReflect() protoreflect.Message

func (*CaptureState) Reset

func (x *CaptureState) Reset()

func (*CaptureState) String

func (x *CaptureState) String() string

type Configure

type Configure struct {
	Routing *RoutingConfig `protobuf:"bytes,1,opt,name=routing,proto3" json:"routing,omitempty"`
	Capture *CaptureConfig `protobuf:"bytes,2,opt,name=capture,proto3" json:"capture,omitempty"`
	// contains filtered or unexported fields
}

Configure declares desired routing and/or capture state. An absent sub-message leaves that facet unchanged; the handler replies with the resulting State.

func (*Configure) Descriptor deprecated

func (*Configure) Descriptor() ([]byte, []int)

Deprecated: Use Configure.ProtoReflect.Descriptor instead.

func (*Configure) GetCapture

func (x *Configure) GetCapture() *CaptureConfig

func (*Configure) GetRouting

func (x *Configure) GetRouting() *RoutingConfig

func (*Configure) ProtoMessage

func (*Configure) ProtoMessage()

func (*Configure) ProtoReflect

func (x *Configure) ProtoReflect() protoreflect.Message

func (*Configure) Reset

func (x *Configure) Reset()

func (*Configure) String

func (x *Configure) String() string

type Exchange

type Exchange struct {
	ID       string    `json:"id"`
	Request  Request   `json:"request"`
	Response *Response `json:"response,omitempty"`
	Error    string    `json:"error,omitempty"`
	Complete bool      `json:"complete"`
}

Exchange is the canonical in-memory form of one observed HTTP exchange, composed of a request and an optional response. The Flow proto message is its wire form; JSON persistence uses this same structure directly. Ordered Pair values preserve duplicate header names without a second projection.

func ExchangeFromFlow

func ExchangeFromFlow(f *Flow) *Exchange

ExchangeFromFlow lifts a wire Flow into its canonical form. ToolId and Timestamp are attribution and transport metadata, not exchange semantics, so they do not cross over.

func ExchangeFromHTTP

func ExchangeFromHTTP(req *http.Request, resp *http.Response, requestBody, responseBody []byte) *Exchange

ExchangeFromHTTP converts the standard library's request/response pair into the canonical HTTP observation model. Callers provide body bytes explicitly because the http bodies are streaming and may already have been consumed by the caller (for example, by file-backed capture).

func (Exchange) Clone

func (e Exchange) Clone() Exchange

Clone returns an independent exchange value, including response metadata and body bytes. The proxy hot store uses it before loading files so a query or subscriber never mutates the retained preview under a read lock.

func (*Exchange) Proto

func (e *Exchange) Proto() *Flow

Proto renders the exchange as a wire Flow. Attribution (ToolId, Timestamp) is the caller's to stamp.

type Flow

type Flow struct {
	Id        string                 `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Error     string                 `protobuf:"bytes,12,opt,name=error,proto3" json:"error,omitempty"`
	Complete  bool                   `protobuf:"varint,13,opt,name=complete,proto3" json:"complete,omitempty"`
	Timestamp *timestamppb.Timestamp `protobuf:"bytes,14,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	Request   *HttpRequest           `protobuf:"bytes,15,opt,name=request,proto3" json:"request,omitempty"`
	Response  *HttpResponse          `protobuf:"bytes,16,opt,name=response,proto3" json:"response,omitempty"` // absent when no response was received
	// contains filtered or unexported fields
}

Flow is one captured request/response exchange. Its nested shape mirrors the consumer's http.exchange form so a consumer can map it directly. Correlation is carried once by aop.operation.Ref on the containing AOP Event. Fields 2-11 were the former embedded correlation and pre-nesting flat shape.

func (*Flow) Descriptor deprecated

func (*Flow) Descriptor() ([]byte, []int)

Deprecated: Use Flow.ProtoReflect.Descriptor instead.

func (*Flow) GetComplete

func (x *Flow) GetComplete() bool

func (*Flow) GetError

func (x *Flow) GetError() string

func (*Flow) GetId

func (x *Flow) GetId() string

func (*Flow) GetRequest

func (x *Flow) GetRequest() *HttpRequest

func (*Flow) GetResponse

func (x *Flow) GetResponse() *HttpResponse

func (*Flow) GetTimestamp

func (x *Flow) GetTimestamp() *timestamppb.Timestamp

func (*Flow) ProtoMessage

func (*Flow) ProtoMessage()

func (*Flow) ProtoReflect

func (x *Flow) ProtoReflect() protoreflect.Message

func (*Flow) Reset

func (x *Flow) Reset()

func (*Flow) String

func (x *Flow) String() string

type FlowFilter

type FlowFilter struct {
	Host   string `protobuf:"bytes,1,opt,name=host,proto3" json:"host,omitempty"`     // host substring
	Status string `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"` // status class or code, e.g. "2xx", "404", "5xx"
	Type   string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"`     // Content-Type substring
	Last   uint32 `protobuf:"varint,4,opt,name=last,proto3" json:"last,omitempty"`    // return only the last N flows (Query)
	// contains filtered or unexported fields
}

FlowFilter bounds which flows are recorded (CaptureConfig) or returned (Query).

func (*FlowFilter) Descriptor deprecated

func (*FlowFilter) Descriptor() ([]byte, []int)

Deprecated: Use FlowFilter.ProtoReflect.Descriptor instead.

func (*FlowFilter) GetHost

func (x *FlowFilter) GetHost() string

func (*FlowFilter) GetLast

func (x *FlowFilter) GetLast() uint32

func (*FlowFilter) GetStatus

func (x *FlowFilter) GetStatus() string

func (*FlowFilter) GetType

func (x *FlowFilter) GetType() string

func (*FlowFilter) ProtoMessage

func (*FlowFilter) ProtoMessage()

func (*FlowFilter) ProtoReflect

func (x *FlowFilter) ProtoReflect() protoreflect.Message

func (*FlowFilter) Reset

func (x *FlowFilter) Reset()

func (*FlowFilter) String

func (x *FlowFilter) String() string

type FlowRecord

type FlowRecord struct {
	Operation *operation.Ref `protobuf:"bytes,1,opt,name=operation,proto3" json:"operation,omitempty"`
	Flow      *Flow          `protobuf:"bytes,2,opt,name=flow,proto3" json:"flow,omitempty"`
	// contains filtered or unexported fields
}

FlowRecord is the resource-query representation. Live observations use the same Flow as Event.extension and carry this Ref in Event.extensions.

func (*FlowRecord) Descriptor deprecated

func (*FlowRecord) Descriptor() ([]byte, []int)

Deprecated: Use FlowRecord.ProtoReflect.Descriptor instead.

func (*FlowRecord) GetFlow

func (x *FlowRecord) GetFlow() *Flow

func (*FlowRecord) GetOperation

func (x *FlowRecord) GetOperation() *operation.Ref

func (*FlowRecord) ProtoMessage

func (*FlowRecord) ProtoMessage()

func (*FlowRecord) ProtoReflect

func (x *FlowRecord) ProtoReflect() protoreflect.Message

func (*FlowRecord) Reset

func (x *FlowRecord) Reset()

func (*FlowRecord) String

func (x *FlowRecord) String() string
type Header struct {
	Name  string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

func (*Header) Descriptor deprecated

func (*Header) Descriptor() ([]byte, []int)

Deprecated: Use Header.ProtoReflect.Descriptor instead.

func (*Header) GetName

func (x *Header) GetName() string

func (*Header) GetValue

func (x *Header) GetValue() string

func (*Header) ProtoMessage

func (*Header) ProtoMessage()

func (*Header) ProtoReflect

func (x *Header) ProtoReflect() protoreflect.Message

func (*Header) Reset

func (x *Header) Reset()

func (*Header) String

func (x *Header) String() string

type HttpRequest

type HttpRequest struct {
	Method   string    `protobuf:"bytes,1,opt,name=method,proto3" json:"method,omitempty"`
	Url      string    `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"`
	Protocol string    `protobuf:"bytes,3,opt,name=protocol,proto3" json:"protocol,omitempty"`
	Headers  []*Header `protobuf:"bytes,4,rep,name=headers,proto3" json:"headers,omitempty"`
	Body     []byte    `protobuf:"bytes,5,opt,name=body,proto3" json:"body,omitempty"`
	// contains filtered or unexported fields
}

HttpRequest is the request half of an exchange.

func (*HttpRequest) Descriptor deprecated

func (*HttpRequest) Descriptor() ([]byte, []int)

Deprecated: Use HttpRequest.ProtoReflect.Descriptor instead.

func (*HttpRequest) GetBody

func (x *HttpRequest) GetBody() []byte

func (*HttpRequest) GetHeaders

func (x *HttpRequest) GetHeaders() []*Header

func (*HttpRequest) GetMethod

func (x *HttpRequest) GetMethod() string

func (*HttpRequest) GetProtocol

func (x *HttpRequest) GetProtocol() string

func (*HttpRequest) GetUrl

func (x *HttpRequest) GetUrl() string

func (*HttpRequest) ProtoMessage

func (*HttpRequest) ProtoMessage()

func (*HttpRequest) ProtoReflect

func (x *HttpRequest) ProtoReflect() protoreflect.Message

func (*HttpRequest) Reset

func (x *HttpRequest) Reset()

func (*HttpRequest) String

func (x *HttpRequest) String() string

type HttpResponse

type HttpResponse struct {
	StatusCode   int32     `protobuf:"varint,1,opt,name=status_code,json=statusCode,proto3" json:"status_code,omitempty"`
	ReasonPhrase string    `protobuf:"bytes,2,opt,name=reason_phrase,json=reasonPhrase,proto3" json:"reason_phrase,omitempty"`
	Headers      []*Header `protobuf:"bytes,3,rep,name=headers,proto3" json:"headers,omitempty"`
	Body         []byte    `protobuf:"bytes,4,opt,name=body,proto3" json:"body,omitempty"`
	// contains filtered or unexported fields
}

HttpResponse is the response half of an exchange. It is optional on Flow: a request that never got a response (timeout, refused connection, one-way capture) has no response half.

func (*HttpResponse) Descriptor deprecated

func (*HttpResponse) Descriptor() ([]byte, []int)

Deprecated: Use HttpResponse.ProtoReflect.Descriptor instead.

func (*HttpResponse) GetBody

func (x *HttpResponse) GetBody() []byte

func (*HttpResponse) GetHeaders

func (x *HttpResponse) GetHeaders() []*Header

func (*HttpResponse) GetReasonPhrase

func (x *HttpResponse) GetReasonPhrase() string

func (*HttpResponse) GetStatusCode

func (x *HttpResponse) GetStatusCode() int32

func (*HttpResponse) ProtoMessage

func (*HttpResponse) ProtoMessage()

func (*HttpResponse) ProtoReflect

func (x *HttpResponse) ProtoReflect() protoreflect.Message

func (*HttpResponse) Reset

func (x *HttpResponse) Reset()

func (*HttpResponse) String

func (x *HttpResponse) String() string

type Pair

type Pair struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

Pair is one HTTP header line: flat, ordered, duplicates preserved. It is the canonical header form both on the wire (proto Header) and in memory; a map cannot express order or repeated names.

func PairsFromHTTP

func PairsFromHTTP(headers http.Header) []Pair

PairsFromHTTP converts net/http headers into the canonical deterministic pair sequence used by Exchange and Flow.

func PairsFromHTTPWithHost

func PairsFromHTTPWithHost(headers http.Header, host string) []Pair

PairsFromHTTPWithHost is PairsFromHTTP plus the Host header net/http hides. The standard library parses the request-line authority into Request.Host and deletes "Host" from Request.Header, so a pair sequence built from the header map alone never carries it. When host is non-empty and no Host header is already present, it is prepended — Host conventionally leads the field block — so a request reconstructed from these pairs is complete and replayable.

type ProtocolMessage

type ProtocolMessage struct {

	// Types that are valid to be assigned to Message:
	//
	//	*ProtocolMessage_Configure
	//	*ProtocolMessage_Query
	//	*ProtocolMessage_State
	//	*ProtocolMessage_FlowRecord
	Message isProtocolMessage_Message `protobuf_oneof:"message"`
	// contains filtered or unexported fields
}

func (*ProtocolMessage) Descriptor deprecated

func (*ProtocolMessage) Descriptor() ([]byte, []int)

Deprecated: Use ProtocolMessage.ProtoReflect.Descriptor instead.

func (*ProtocolMessage) GetConfigure

func (x *ProtocolMessage) GetConfigure() *Configure

func (*ProtocolMessage) GetFlowRecord

func (x *ProtocolMessage) GetFlowRecord() *FlowRecord

func (*ProtocolMessage) GetMessage

func (x *ProtocolMessage) GetMessage() isProtocolMessage_Message

func (*ProtocolMessage) GetQuery

func (x *ProtocolMessage) GetQuery() *Query

func (*ProtocolMessage) GetState

func (x *ProtocolMessage) GetState() *State

func (*ProtocolMessage) ProtoMessage

func (*ProtocolMessage) ProtoMessage()

func (*ProtocolMessage) ProtoReflect

func (x *ProtocolMessage) ProtoReflect() protoreflect.Message

func (*ProtocolMessage) Reset

func (x *ProtocolMessage) Reset()

func (*ProtocolMessage) String

func (x *ProtocolMessage) String() string

type ProtocolMessage_Configure

type ProtocolMessage_Configure struct {
	Configure *Configure `protobuf:"bytes,10,opt,name=configure,proto3,oneof"`
}

type ProtocolMessage_FlowRecord

type ProtocolMessage_FlowRecord struct {
	FlowRecord *FlowRecord `protobuf:"bytes,13,opt,name=flow_record,json=flowRecord,proto3,oneof"`
}

type ProtocolMessage_Query

type ProtocolMessage_Query struct {
	Query *Query `protobuf:"bytes,11,opt,name=query,proto3,oneof"`
}

type ProtocolMessage_State

type ProtocolMessage_State struct {
	State *State `protobuf:"bytes,12,opt,name=state,proto3,oneof"`
}

type Query

type Query struct {
	State  bool        `protobuf:"varint,1,opt,name=state,proto3" json:"state,omitempty"`  // request current State
	Flows  bool        `protobuf:"varint,2,opt,name=flows,proto3" json:"flows,omitempty"`  // request recorded flows (batched Flow replies)
	Filter *FlowFilter `protobuf:"bytes,3,opt,name=filter,proto3" json:"filter,omitempty"` // filter for flows = true
	// contains filtered or unexported fields
}

Query requests a snapshot: the current State and/or the recorded flows.

func (*Query) Descriptor deprecated

func (*Query) Descriptor() ([]byte, []int)

Deprecated: Use Query.ProtoReflect.Descriptor instead.

func (*Query) GetFilter

func (x *Query) GetFilter() *FlowFilter

func (*Query) GetFlows

func (x *Query) GetFlows() bool

func (*Query) GetState

func (x *Query) GetState() bool

func (*Query) ProtoMessage

func (*Query) ProtoMessage()

func (*Query) ProtoReflect

func (x *Query) ProtoReflect() protoreflect.Message

func (*Query) Reset

func (x *Query) Reset()

func (*Query) String

func (x *Query) String() string

type Request

type Request struct {
	Method   string `json:"method"`
	URL      string `json:"url"`
	Protocol string `json:"protocol,omitempty"`
	Headers  []Pair `json:"headers,omitempty"`
	Body     []byte `json:"body,omitempty"`
}

Request is the request half of an exchange.

type Response

type Response struct {
	StatusCode   int    `json:"status_code"`
	ReasonPhrase string `json:"reason_phrase,omitempty"`
	Headers      []Pair `json:"headers,omitempty"`
	Body         []byte `json:"body,omitempty"`
}

Response is the response half of an exchange. It is optional on Exchange: a request that never got a response (timeout, refused connection, one-way capture) has no response half.

type RoutingConfig

type RoutingConfig struct {
	Mode     RoutingMode `protobuf:"varint,1,opt,name=mode,proto3,enum=aop.traffic.RoutingMode" json:"mode,omitempty"`
	Url      string      `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"`           // proxy URL (PROXY) or subscription URL (SUBSCRIBE/AUTO)
	Selector string      `protobuf:"bytes,3,opt,name=selector,proto3" json:"selector,omitempty"` // node name or 1-based index (SWITCH)
	Type     string      `protobuf:"bytes,4,opt,name=type,proto3" json:"type,omitempty"`         // protocol filter, e.g. "trojan,vless" (AUTO)
	Name     string      `protobuf:"bytes,5,opt,name=name,proto3" json:"name,omitempty"`         // node name keyword (AUTO)
	Country  string      `protobuf:"bytes,6,opt,name=country,proto3" json:"country,omitempty"`   // ISO 3166-1 alpha-2 filter, e.g. "HK,JP" (AUTO)
	Strategy string      `protobuf:"bytes,7,opt,name=strategy,proto3" json:"strategy,omitempty"` // adaptive|url-test|round-robin|random (AUTO)
	// contains filtered or unexported fields
}

RoutingConfig steers the egress chain (State in tools/proxy). Fields beyond mode/url/selector are the auto-mode subscription filters.

func (*RoutingConfig) Descriptor deprecated

func (*RoutingConfig) Descriptor() ([]byte, []int)

Deprecated: Use RoutingConfig.ProtoReflect.Descriptor instead.

func (*RoutingConfig) GetCountry

func (x *RoutingConfig) GetCountry() string

func (*RoutingConfig) GetMode

func (x *RoutingConfig) GetMode() RoutingMode

func (*RoutingConfig) GetName

func (x *RoutingConfig) GetName() string

func (*RoutingConfig) GetSelector

func (x *RoutingConfig) GetSelector() string

func (*RoutingConfig) GetStrategy

func (x *RoutingConfig) GetStrategy() string

func (*RoutingConfig) GetType

func (x *RoutingConfig) GetType() string

func (*RoutingConfig) GetUrl

func (x *RoutingConfig) GetUrl() string

func (*RoutingConfig) ProtoMessage

func (*RoutingConfig) ProtoMessage()

func (*RoutingConfig) ProtoReflect

func (x *RoutingConfig) ProtoReflect() protoreflect.Message

func (*RoutingConfig) Reset

func (x *RoutingConfig) Reset()

func (*RoutingConfig) String

func (x *RoutingConfig) String() string

type RoutingMode

type RoutingMode int32

RoutingMode selects how the egress chain is set. UNSPECIFIED leaves routing unchanged so a Configure can steer capture without touching the proxy.

const (
	RoutingMode_ROUTING_MODE_UNSPECIFIED RoutingMode = 0
	RoutingMode_ROUTING_MODE_DIRECT      RoutingMode = 1 // revert to the original/direct egress
	RoutingMode_ROUTING_MODE_PROXY       RoutingMode = 2 // single proxy URL (url)
	RoutingMode_ROUTING_MODE_SUBSCRIBE   RoutingMode = 3 // load a clash subscription (url), no switch
	RoutingMode_ROUTING_MODE_AUTO        RoutingMode = 4 // subscription + adaptive load balancing
	RoutingMode_ROUTING_MODE_SWITCH      RoutingMode = 5 // switch active node within a loaded subscription
	RoutingMode_ROUTING_MODE_CLEAR       RoutingMode = 6 // clear subscription, revert to original
)

func (RoutingMode) Descriptor

func (RoutingMode) Enum

func (x RoutingMode) Enum() *RoutingMode

func (RoutingMode) EnumDescriptor deprecated

func (RoutingMode) EnumDescriptor() ([]byte, []int)

Deprecated: Use RoutingMode.Descriptor instead.

func (RoutingMode) Number

func (x RoutingMode) Number() protoreflect.EnumNumber

func (RoutingMode) String

func (x RoutingMode) String() string

func (RoutingMode) Type

type RoutingState

type RoutingState struct {
	ActiveNode string `protobuf:"bytes,1,opt,name=active_node,json=activeNode,proto3" json:"active_node,omitempty"`
	EgressUrl  string `protobuf:"bytes,2,opt,name=egress_url,json=egressUrl,proto3" json:"egress_url,omitempty"`
	Auto       bool   `protobuf:"varint,3,opt,name=auto,proto3" json:"auto,omitempty"`
	// contains filtered or unexported fields
}

func (*RoutingState) Descriptor deprecated

func (*RoutingState) Descriptor() ([]byte, []int)

Deprecated: Use RoutingState.ProtoReflect.Descriptor instead.

func (*RoutingState) GetActiveNode

func (x *RoutingState) GetActiveNode() string

func (*RoutingState) GetAuto

func (x *RoutingState) GetAuto() bool

func (*RoutingState) GetEgressUrl

func (x *RoutingState) GetEgressUrl() string

func (*RoutingState) ProtoMessage

func (*RoutingState) ProtoMessage()

func (*RoutingState) ProtoReflect

func (x *RoutingState) ProtoReflect() protoreflect.Message

func (*RoutingState) Reset

func (x *RoutingState) Reset()

func (*RoutingState) String

func (x *RoutingState) String() string

type State

type State struct {
	Routing *RoutingState `protobuf:"bytes,1,opt,name=routing,proto3" json:"routing,omitempty"`
	Capture *CaptureState `protobuf:"bytes,2,opt,name=capture,proto3" json:"capture,omitempty"`
	Error   string        `protobuf:"bytes,3,opt,name=error,proto3" json:"error,omitempty"`
	// contains filtered or unexported fields
}

State is the runner's reply to Configure/Query.

func (*State) Descriptor deprecated

func (*State) Descriptor() ([]byte, []int)

Deprecated: Use State.ProtoReflect.Descriptor instead.

func (*State) GetCapture

func (x *State) GetCapture() *CaptureState

func (*State) GetError

func (x *State) GetError() string

func (*State) GetRouting

func (x *State) GetRouting() *RoutingState

func (*State) ProtoMessage

func (*State) ProtoMessage()

func (*State) ProtoReflect

func (x *State) ProtoReflect() protoreflect.Message

func (*State) Reset

func (x *State) Reset()

func (*State) String

func (x *State) String() string

type WebSocketExchange

type WebSocketExchange struct {
	ID        string
	URL       string
	Protocol  string
	Headers   []Pair
	Messages  []WebSocketMessage
	StartTime time.Time
	EndTime   time.Time
	Complete  bool
	Error     string
}

WebSocketExchange contains the handshake metadata and message stream for a WebSocket connection. The HTTP handshake itself can still be represented by Exchange; this type is for the bidirectional messages that follow it.

type WebSocketMessage

type WebSocketMessage struct {
	Direction string
	Type      string
	Body      []byte
	Timestamp time.Time
}

WebSocketMessage is a single message observed after an HTTP WebSocket handshake. WebSocket traffic is deliberately modeled separately from an HTTP Exchange while sharing the same header pair representation.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL