remenv

package
v1.15.3 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2026 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HeaderAPIKey        = "X-API-Key" // #nosec G101: header name, not a credential
	HeaderAuthorization = "Authorization"
	HeaderCookie        = "Cookie"
	HeaderAgentToken    = "X-Arcane-Agent-Token" // #nosec G101: header name, not a credential
	HeaderUpgrade       = "Upgrade"
	HeaderConnection    = "Connection"

	ConnectionUpgradeToken = "upgrade"
)

Variables

This section is empty.

Functions

func BuildHopByHopHeaders

func BuildHopByHopHeaders(respHeader http.Header) map[string]struct{}

func BuildWebSocketHeaders

func BuildWebSocketHeaders(c *gin.Context, accessToken *string) http.Header

BuildWebSocketHeaders constructs a header set for proxying WebSocket requests to a remote environment, forwarding authentication in the same way as HTTP proxying.

func CopyBodyWithFlush

func CopyBodyWithFlush(w http.ResponseWriter, body io.Reader)

CopyBodyWithFlush streams bytes from body to w, flushing when supported. Useful for progress/streaming endpoints where incremental delivery matters.

func CopyRequestHeaders

func CopyRequestHeaders(from http.Header, to http.Header, skip map[string]struct{})

func CopyResponseHeaders

func CopyResponseHeaders(from http.Header, to http.Header, hop map[string]struct{})

func GetHopByHopHeaders

func GetHopByHopHeaders() map[string]struct{}

func GetSkipHeaders

func GetSkipHeaders() map[string]struct{}

func HTTPToWebSocketURL

func HTTPToWebSocketURL(url string) string

HTTPToWebSocketURL converts an HTTP(S) URL to WS(S).

func SetAgentToken

func SetAgentToken(req *http.Request, accessToken *string)

func SetAuthHeader

func SetAuthHeader(req *http.Request, c *gin.Context)

func SetForwardedHeaders

func SetForwardedHeaders(req *http.Request, clientIP, host string)

Types

This section is empty.

Jump to

Keyboard shortcuts

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