server

package
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2020 License: MIT Imports: 40 Imported by: ? 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

View Source
const (
	// LambdaMinMemorySize is the minimum memory size for a Lambda function in MB
	LambdaMinMemorySize = 128
	// LambdaMaxMemorySize is the maximum memory size for a Lambda function in MB
	LambdaMaxMemorySize = 3008

	// LambdaDelayedCleanupTime is the time to wait if active connections still exist
	// this should be never be higher than LambdaExecutionTimeoutBuffer or function timeout
	// will happen before cleanup occurs
	LambdaDelayedCleanupTime = time.Second * 20
	// LambdaExecutionTimeoutBuffer is the time added to user specified execution frequency
	// to get the overall function timeout value
	LambdaExecutionTimeoutBuffer = time.Second * 30

	// LambdaMinExecutionFrequency is the minimum frequency for function execution.
	LambdaMinExecutionFrequency = time.Second * 60
	// LambdaMaxExecutionFrequency is the maximum frequency for function execution.
	// The current max execution time is 900 seconds, but this takes into account
	// LambdaExecutionTimeoutBuffer + 10 seconds of leeway
	LambdaMaxExecutionFrequency = time.Second * 860
)

Variables

This section is empty.

Functions

func GetSessionAWS

func GetSessionAWS() (*session.Session, error)

func GetValidLambdaRegions

func GetValidLambdaRegions() []string

func NewSSHManager

func NewSSHManager() ([]byte, error)

NewSSHManager generates an ssh key and adds to authorized_keys so Lambda can connect to the host

func SetupLambdaInfrastructure

func SetupLambdaInfrastructure(lambdaIamRole string) error

SetupLambdaInfrastructure sets up IAM role needed to run awslambdaproxy

Types

type Config

type Config struct {
	// LambdaName is a name of Lambda function
	LambdaName string
	// LambdaIamRoleName is a name of Lambda function IAM role
	LambdaIamRoleName string
	// LambdaRegions is all regions to execute Lambda functions in
	LambdaRegions []string
	// LambdaMemory is the size of memory to assign Lambda function
	LambdaMemory int
	// LambdaExecutionFrequency is the frequency at which to execute Lambda functions
	LambdaExecutionFrequency time.Duration
	// ProxyListeners defines all listeners, protocol, and auth information
	// in format like this [scheme://][user:pass@host]:port.
	// see https://github.com/ginuerzh/gost/blob/master/README_en.md#getting-started
	ProxyListeners []string
	// ProxyDebug is whether debug logging should be shown for proxy traffic
	// note this will log all visited domains
	ProxyDebug bool
	// ReverseTunnelSSHUser is the ssh user to use for the lambda reverse ssh tunnel
	ReverseTunnelSSHUser string
	// ReverseTunnelSSHPort is the ssh port to use for the lambda reverse ssh tunnel
	ReverseTunnelSSHPort string
	// Debug enables general debug logging
	Debug bool
	// Bypass is a comma separated list of ips/domains to bypass proxy
	Bypass string
}

Config is used to define the configuration for Server

type LocalProxy

type LocalProxy struct {
	// contains filtered or unexported fields
}

LocalProxy is proxy listener and where to forward

func NewLocalProxy

func NewLocalProxy(listeners []string, debugProxy bool, bypass string) (*LocalProxy, error)

NewLocalProxy starts a local proxy that will forward to proxy running in Lambda

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server is the long running server component of awslambdaproxy

func New

func New(config Config) (*Server, error)

func (*Server) Run

func (s *Server) Run()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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