proxy

package
v1.23.0-alpha.3 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2023 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AgentModeApiServer = "apiServerProxy"
	AgentModeAHTTP     = "http"
	AgentModeHTTPS     = "https"
)

Variables

This section is empty.

Functions

func ParseProxyObj

func ParseProxyObj(c *gin.Context, path string) *audit.ProxyObject

func RoundTripOf

func RoundTripOf(cli agents.Client) http.RoundTripper

RoundTripOf

func Transport

func Transport(local, proxy *websocket.Conn, c *gin.Context, user models.CommonUserIface, auditFunc func(string))

Types

type Msg

type Msg struct {
	MsgType int
	Content []byte
}

type ProxyHandler

type ProxyHandler struct {
	base.BaseHandler
}

func (*ProxyHandler) Proxy

func (h *ProxyHandler) Proxy(c *gin.Context)

不需要swagger

func (*ProxyHandler) ProxyHTTP

func (h *ProxyHandler) ProxyHTTP(c *gin.Context)

func (*ProxyHandler) ProxyService

func (h *ProxyHandler) ProxyService(c *gin.Context)

func (*ProxyHandler) ProxyWebsocket

func (h *ProxyHandler) ProxyWebsocket(c *gin.Context)

func (*ProxyHandler) ReverseProxyOn

func (h *ProxyHandler) ReverseProxyOn(cli agents.Client) *httputil.ReverseProxy

type ProxyObject

type ProxyObject struct {
	NamespacedScoped bool
	Cluster          string
	Namespace        string
	Name             string
	Group            string
	Version          string
	Resource         string
	Action           string
}

func (*ProxyObject) InNamespace

func (p *ProxyObject) InNamespace() bool

type RoundTripperFunc

type RoundTripperFunc func(req *http.Request) (*http.Response, error)

func (RoundTripperFunc) RoundTrip

func (c RoundTripperFunc) RoundTrip(req *http.Request) (*http.Response, error)

type WebSocketProxy

type WebSocketProxy struct {
	RequestContext *gin.Context
	Source         *websocket.Conn
	Target         *websocket.Conn
	SourceChan     chan Msg
	TargetChan     chan Msg
	Done           chan bool
	Username       string
	AuditFunc      func(string)
	// contains filtered or unexported fields
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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