razproxy

package module
v0.0.0-...-6200ffa Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2020 License: MIT Imports: 27 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

This section is empty.

Variables

View Source
var ErrAuthFailed = fmt.Errorf("authentication failed")

ErrAuthFailed ...

Functions

This section is empty.

Types

type AuthRequest

type AuthRequest struct {
	User     string
	Password string
}

AuthRequest ...

type AuthResult

type AuthResult struct {
	OK bool
	ID string
}

AuthResult ...

type Authenticator

type Authenticator interface {
	Valid(user, password string) bool
}

Authenticator ...

type BasicAuthenticator

type BasicAuthenticator map[string]string

BasicAuthenticator ...

func (BasicAuthenticator) Valid

func (auth BasicAuthenticator) Valid(user, password string) bool

Valid ...

type CertLoader

type CertLoader interface {
	GetCertificate(*tls.ClientHelloInfo) (*tls.Certificate, error)
}

CertLoader ...

func NewFileCertLoader

func NewFileCertLoader(certFile, keyFile string, logger *log.Logger) (CertLoader, error)

NewFileCertLoader returns a CertLoader that reads a certificate file and watches for updates

func NewGeneratedCertLoader

func NewGeneratedCertLoader(name, org string) (CertLoader, error)

NewGeneratedCertLoader returns a CertLoader that supplies a generated certificate

type Client

type Client struct {
	Logger *log.Logger
	// contains filtered or unexported fields
}

Client ...

func NewClient

func NewClient(serverAddr string, conf *ClientConfig) (*Client, error)

NewClient returns a new Client

func (*Client) ListenAndServe

func (c *Client) ListenAndServe(port uint16) error

ListenAndServe opens a local SOCKS5 port that listens to and transmits requests to the server

type ClientConfig

type ClientConfig struct {
	User                 string
	Password             string
	SkipCertVerify       bool
	PromptSkipCertVerify func() bool
}

ClientConfig ...

type NilAuthenticator

type NilAuthenticator struct{}

NilAuthenticator ...

func (NilAuthenticator) Valid

func (auth NilAuthenticator) Valid(user, password string) bool

Valid ...

type RPC

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

RPC ...

func (*RPC) Auth

func (rpc *RPC) Auth(req *AuthRequest, result *AuthResult) error

Auth is an RPC function to authenticate the client

type Server

type Server struct {
	Logger      *log.Logger
	ExternalDNS string
	LAN         bool
	// contains filtered or unexported fields
}

Server ...

func NewServer

func NewServer(auth Authenticator, certLoader CertLoader, logger *log.Logger) (*Server, error)

NewServer returns a new Server

func (*Server) ListenAndServe

func (s *Server) ListenAndServe(address string) error

ListenAndServe starts listening and serving requests on a given network address

Directories

Path Synopsis
cmd
razproxy-client command
razproxy-server command

Jump to

Keyboard shortcuts

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