proxy

package
v2.0.0-alpha56 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2024 License: Apache-2.0 Imports: 38 Imported by: 0

README

Proxy Package Documentation

This package includes modules that the hooks package utilizes to redirect the outgoing calls of the user API. This redirection is done with the aim to record or stub the outputs of dependency calls.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Emoji = "\U0001F430" + " Keploy:"
View Source
var ParsersMap = make(map[string]DependencyHandler)

Functions

func ExtractCertToTemp

func ExtractCertToTemp() (string, error)

to extract ca certificate to temp

func InstallJavaCA

func InstallJavaCA(logger *zap.Logger, caPath string, pid uint32, isJavaServe bool)

InstallJavaCA installs the CA in the Java keystore

func JavaCAExists

func JavaCAExists(alias, storepass, cacertsPath string) bool

JavaCAExists checks if the CA is already installed in the specified Java keystore

func Register

func Register(parserName string, parser DependencyHandler)

Types

type Conn

type Conn struct {
	net.Conn
	// contains filtered or unexported fields
}

func (*Conn) Read

func (c *Conn) Read(b []byte) (n int, err error)

type CustomConn

type CustomConn struct {
	net.Conn
	// contains filtered or unexported fields
}

func (*CustomConn) Read

func (c *CustomConn) Read(p []byte) (int, error)

type DependencyHandler

type DependencyHandler interface {
	OutgoingType(buffer []byte) bool
	ProcessOutgoing(buffer []byte, conn net.Conn, dst net.Conn, ctx context.Context)
}

type Option

type Option struct {
	Port          uint32
	MongoPassword string
}

Option provides a means to initiate the proxy based on user input.

type ProxySet

type ProxySet struct {
	IP4  uint32
	IP6  [4]uint32
	Port uint32

	FilterPid bool

	Listener         net.Listener
	DnsServer        *dns.Server
	DnsServerTimeout time.Duration

	PassThroughPorts []uint
	MongoPassword    string // password to mock the mongo connection and pass the authentication requests
	// contains filtered or unexported fields
}

func BootProxy

func BootProxy(logger *zap.Logger, opt Option, appCmd, appContainer string, pid uint32, lang string, passThroughPorts []uint, h *hooks.Hook, ctx context.Context, delay uint64) *ProxySet

BootProxy starts proxy server on the idle local port, Default:16789

func (*ProxySet) ServeDNS

func (ps *ProxySet) ServeDNS(w dns.ResponseWriter, r *dns.Msg)

func (*ProxySet) StopProxyServer

func (ps *ProxySet) StopProxyServer()

Directories

Path Synopsis
integrations

Jump to

Keyboard shortcuts

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