Documentation
¶
Index ¶
- Constants
- func GetBuffer() *[]byte
- func PutBuffer(b *[]byte)
- type BoundedCaptureWriter
- type EBPFManager
- type ProxyServer
- func (p *ProxyServer) Close() error
- func (p *ProxyServer) GetMockEngine() *mock.Engine
- func (p *ProxyServer) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (p *ProxyServer) SetInsecureUpstreamTLS(insecure bool)
- func (p *ProxyServer) SetMockEngine(eng *mock.Engine)
- func (p *ProxyServer) Start() error
- type RedirectionMode
Constants ¶
const DefaultMaxBodyCaptureBytes = 64 * 1024
DefaultMaxBodyCaptureBytes limits how many bytes of a body are buffered for security scanning (64 KB). The rest of the stream passes through to the client at full line-rate without consuming RAM.
const StreamBufferSize = 32 * 1024
StreamBufferSize defines the buffer size used for streaming data chunks (32 KB).
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BoundedCaptureWriter ¶
type BoundedCaptureWriter struct {
// contains filtered or unexported fields
}
BoundedCaptureWriter records up to limit bytes while accepting unbounded writes.
func NewBoundedCaptureWriter ¶
func NewBoundedCaptureWriter(limit int) *BoundedCaptureWriter
NewBoundedCaptureWriter creates a writer that caps stored bytes at limit.
func ReadAndCapture ¶
func ReadAndCapture(rc io.ReadCloser, limit int) (io.ReadCloser, *BoundedCaptureWriter)
ReadAndCapture wraps an io.ReadCloser with a bounded capture buffer. As the caller reads from the returned reader, bytes are streamed directly while the first 'limit' bytes are copied into the capture buffer.
func (*BoundedCaptureWriter) Bytes ¶
func (w *BoundedCaptureWriter) Bytes() []byte
Bytes returns the captured bytes.
type EBPFManager ¶
EBPFManager coordinates transparent traffic redirection.
func NewEBPFManager ¶
func NewEBPFManager(proxyPort int) *EBPFManager
NewEBPFManager initializes the eBPF / redirection coordinator.
func (*EBPFManager) CheckEnvironmentSupport ¶
func (m *EBPFManager) CheckEnvironmentSupport() (bool, string)
CheckEnvironmentSupport checks if the host OS supports eBPF socket redirection directly.
func (*EBPFManager) GenerateEBPFInstructions ¶
func (m *EBPFManager) GenerateEBPFInstructions() string
GenerateEBPFInstructions returns the Linux eBPF cgroup program and iptables redirection script.
type ProxyServer ¶
type ProxyServer struct {
// contains filtered or unexported fields
}
ProxyServer is the high-throughput asynchronous proxy engine.
func NewProxyServer ¶
func NewProxyServer(addr string, cm *certs.CertificateManager, rb *ringbuffer.RingBuffer) *ProxyServer
NewProxyServer creates a new ProxyServer.
func (*ProxyServer) GetMockEngine ¶
func (p *ProxyServer) GetMockEngine() *mock.Engine
GetMockEngine returns the active mock & chaos engine.
func (*ProxyServer) ServeHTTP ¶
func (p *ProxyServer) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP delegates between HTTPS CONNECT tunneling (TLS bumping) and plain HTTP proxy requests.
func (*ProxyServer) SetInsecureUpstreamTLS ¶
func (p *ProxyServer) SetInsecureUpstreamTLS(insecure bool)
SetInsecureUpstreamTLS enables or disables skipping certificate verification on upstream endpoints.
func (*ProxyServer) SetMockEngine ¶
func (p *ProxyServer) SetMockEngine(eng *mock.Engine)
SetMockEngine configures the mock & chaos engine.
func (*ProxyServer) Start ¶
func (p *ProxyServer) Start() error
Start runs the proxy server listener.
type RedirectionMode ¶
type RedirectionMode string
RedirectionMode describes the network interception strategy.
const ( ModeExplicitProxy RedirectionMode = "EXPLICIT_HTTP_PROXY" ModeEBPF RedirectionMode = "EBPF_CGROUP" ModeIPTables RedirectionMode = "IPTABLES_TRANSPARENT" )