wsproxy
packageThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
Links
Documentation¶
Index¶
Constants¶
This section is empty.
Variables¶
This section is empty.
Functions¶
This section is empty.
Types¶
typeOptions¶
type Options struct {Loggerslog.LoggerExperimentscodersdk.ExperimentsHTTPClient *http.Client// DashboardURL is the URL of the primary coderd instance.DashboardURL *url.URL// AccessURL is the URL of the WorkspaceProxy.AccessURL *url.URL// TODO: @emyrk We use these two fields in many places with this comment.//Maybe we should make some shared options struct?// AppHostname should be the wildcard hostname to use for workspace// applications INCLUDING the asterisk, (optional) suffix and leading dot.// It will use the same scheme and port number as the access URL.// E.g. "*.apps.coder.com" or "*-apps.coder.com".AppHostnamestring// AppHostnameRegex contains the regex version of options.AppHostname as// generated by appurl.CompileHostnamePattern(). It MUST be set if// options.AppHostname is set.AppHostnameRegex *regexp.RegexpRealIPConfig *httpmw.RealIPConfigTracingtrace.TracerProviderPrometheusRegistry *prometheus.RegistryTLSCertificates []tls.CertificateAPIRateLimitintCookieConfigcodersdk.HTTPCookieConfigDisablePathAppsboolDERPEnabledboolDERPServerRelayAddressstring// DERPOnly determines whether this proxy only provides DERP and does not// provide access to workspace apps/terminal.DERPOnlybool// BlockDirect controls the servertailnet of the proxy, forcing it from// negotiating direct connections.BlockDirectbool// ReplicaErrCallback is called when the proxy replica successfully or// unsuccessfully pings its peers in the mesh.ReplicaErrCallback func(replicas []codersdk.Replica, errstring)ProxySessionTokenstring// AllowAllCors will set all CORs headers to '*'.// By default, CORs is set to accept external requests// from the dashboardURL. This should only be used in development.AllowAllCorsboolStatsCollectorOptionsworkspaceapps.StatsCollectorOptions}
typeProxyFetcher¶added inv2.17.0
type ProxyFetcher struct {Client *wsproxysdk.Client}
func (*ProxyFetcher)Fetch¶added inv2.17.0
func (p *ProxyFetcher) Fetch(ctxcontext.Context, featurecodersdk.CryptoKeyFeature) ([]codersdk.CryptoKey,error)
typeServer¶
type Server struct {Options *OptionsHandler chi.RouterDashboardURL *url.URLAppServer *workspaceapps.Server// Logging/MetricsLoggerslog.LoggerTracerProvidertrace.TracerProviderPrometheusRegistry *prometheus.Registry// SDKClient is a client to the primary coderd instance authenticated with// the moon's token.SDKClient *wsproxysdk.Client// contains filtered or unexported fields}
Server is an external workspace proxy server. This server can communicatedirectly with a workspace. It requires a primary coderd to establish a saidconnection.
funcNew¶
New creates a new workspace proxy server. This requires a primary coderdinstance to be reachable and the correct authorization access token to beprovided. If the proxy cannot authenticate with the primary, this will fail.
func (*Server)RegisterNow¶added inv2.8.5
typeTokenProvider¶
type TokenProvider struct {DashboardURL *url.URLAccessURL *url.URLAppHostnamestringClient *wsproxysdk.ClientTokenSigningKeycachecryptokeys.SigningKeycacheAPIKeyEncryptionKeycachecryptokeys.EncryptionKeycacheLoggerslog.Logger}
func (*TokenProvider)FromRequest¶
func (p *TokenProvider) FromRequest(r *http.Request) (*workspaceapps.SignedToken,bool)
func (*TokenProvider)Issue¶
func (p *TokenProvider) Issue(ctxcontext.Context, rwhttp.ResponseWriter, r *http.Request, issueReqworkspaceapps.IssueTokenRequest) (*workspaceapps.SignedToken,string,bool)