reverseproxy

package
v0.0.80 Latest Latest
Warning

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

Go to latest
Published: May 7, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetGatewayIP

func GetGatewayIP() (string, error)

GetGatewayIP returns the default gateway IP address by executing 'ip route'

Types

type TLSClient

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

TLSClient represents a non-TLS server that proxies connections to a TLS server

func NewTLSClient

func NewTLSClient(localPort int, remoteHost string, remotePort int, caCertPEM, clientCertPEM, clientKeyPEM []byte) (*TLSClient, error)

NewTLSClient creates a new TLS client proxy

func (*TLSClient) Start

func (c *TLSClient) Start(ctx context.Context) error

Start starts the non-TLS server and proxies connections to the TLS server

type TLSServer

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

TLSServer represents a TLS server with mTLS authentication

func NewTLSServer

func NewTLSServer(targetPort int) (*TLSServer, error)

NewTLSServer creates a new TLS server with generated certificates

func (*TLSServer) GenerateClientCert

func (s *TLSServer) GenerateClientCert() ([]byte, []byte, error)

GenerateClientCert generates a client certificate signed by the CA

func (*TLSServer) GetCACertPEM

func (s *TLSServer) GetCACertPEM() ([]byte, error)

GetCACertPEM returns the CA certificate in PEM format

func (*TLSServer) Start

func (s *TLSServer) Start(ctx context.Context) (int, error)

Start starts the TLS server on a random port and returns the allocated port

Jump to

Keyboard shortcuts

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