Movatterモバイル変換


[0]ホーム

URL:


wsproxy

package
v2.23.0Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2025 License:AGPL-3.0Imports:39Imported by:0

Details

Repository

github.com/coder/coder

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}

func (*Options)Validate

func (o *Options) Validate()error

typeProxyFetcheradded inv2.17.0

type ProxyFetcher struct {Client *wsproxysdk.Client}

func (*ProxyFetcher)Fetchadded inv2.17.0

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

func New(ctxcontext.Context, opts *Options) (*Server,error)

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)Close

func (s *Server) Close()error

func (*Server)RegisterNowadded inv2.8.5

func (s *Server) RegisterNow()error

typeTokenProvider

type TokenProvider struct {DashboardURL *url.URLAccessURL    *url.URLAppHostnamestringClient                   *wsproxysdk.ClientTokenSigningKeycachecryptokeys.SigningKeycacheAPIKeyEncryptionKeycachecryptokeys.EncryptionKeycacheLoggerslog.Logger}

func (*TokenProvider)FromRequest

Source Files

View all Source files

Directories

PathSynopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp