Documentation
¶
Overview ¶
Package activator contains a userspace TCP proxy that listens on a random port and loads an eBPF program to intercept and redirect packets destined to the configured ports. The activator accepts the connection, calls onAccept, signals to disable the eBPF redirect and then proxies the initial data to the defined ports as soon as something is listening.
Index ¶
- Constants
- Variables
- func MapsPath() string
- func MountBPFFS(path string) error
- func PinPath(pid int) string
- type BPF
- type ConnHook
- type RestoreHook
- type Server
- func (s *Server) DisableRedirects() error
- func (s *Server) RedirectPort(from, to uint16) error
- func (s *Server) Reset() error
- func (s *Server) SetPeekBufferSize(size int)
- func (s *Server) Start(ctx context.Context, ports []uint16, connHook ConnHook, ...) error
- func (s *Server) Started() bool
- func (s *Server) Stop(ctx context.Context)
Constants ¶
View Source
const BPFFSPath = "/sys/fs/bpf"
Variables ¶
View Source
var ErrMapNotFound = errors.New("bpf map could not be found")
Functions ¶
func MountBPFFS ¶ added in v0.2.0
MountBPFFS executes a bpf mount on the supplied path. It has been adapted by: https://github.com/cilium/cilium/blob/cf3889af46a4058d5e89495d502fc19c10713110/pkg/bpf/bpffs_linux.go#L124
Types ¶
type BPF ¶ added in v0.2.0
type BPF struct {
// contains filtered or unexported fields
}
func (*BPF) AttachRedirector ¶ added in v0.2.0
type RestoreHook ¶ added in v0.7.0
type RestoreHook func() error
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) DisableRedirects ¶ added in v0.1.0
func (*Server) RedirectPort ¶ added in v0.1.0
RedirectPort redirects the port from to on ingress and to from on egress.
func (*Server) SetPeekBufferSize ¶ added in v0.7.0
Click to show internal directories.
Click to hide internal directories.