Documentation ¶
Index ¶
- Constants
- func WithAllowCIDR(net ...*net.IPNet) interface{ ... }
- func WithAllowCIDRString(cidr ...string) interface{ ... }
- func WithDenyCIDR(net ...*net.IPNet) interface{ ... }
- func WithDenyCIDRString(cidr ...string) interface{ ... }
- func WithDomain(name string) interface{ ... }
- func WithForwardsTo(meta string) interface{ ... }
- func WithHTTPHandler(h http.Handler) interface{ ... }
- func WithHTTPServer(srv *http.Server) interface{ ... }
- func WithMetadata(meta string) interface{ ... }
- func WithMutualTLSCA(certs ...*x509.Certificate) interface{ ... }
- func WithProxyProto(version ProxyProtoVersion) interface{ ... }
- type HTTPEndpointOption
- func WithBasicAuth(username, password string) HTTPEndpointOption
- func WithCircuitBreaker(ratio float64) HTTPEndpointOption
- func WithCompression() HTTPEndpointOption
- func WithOAuth(provider string, opts ...OAuthOption) HTTPEndpointOption
- func WithOIDC(issuerURL string, clientID string, clientSecret string, opts ...OIDCOption) HTTPEndpointOption
- func WithRemoveRequestHeader(name string) HTTPEndpointOption
- func WithRemoveResponseHeader(name string) HTTPEndpointOption
- func WithRequestHeader(name, value string) HTTPEndpointOption
- func WithResponseHeader(name, value string) HTTPEndpointOption
- func WithScheme(scheme Scheme) HTTPEndpointOption
- func WithWebhookVerification(provider string, secret string) HTTPEndpointOption
- func WithWebsocketTCPConversion() HTTPEndpointOption
- type LabeledTunnelOption
- type OAuthOption
- type OIDCOption
- type ProxyProtoVersion
- type Scheme
- type TCPEndpointOption
- type TLSEndpointOption
- type Tunnel
Constants ¶
const ( // PROXY protocol disabled ProxyProtoNone = ProxyProtoVersion(0) // PROXY protocol v1 ProxyProtoV1 = ProxyProtoVersion(1) // PROXY protocol v2 ProxyProtoV2 = ProxyProtoVersion(2) )
const ( SchemeHTTP = Scheme("http") // The 'https' URL scheme. SchemeHTTPS = Scheme("https") )
The 'http' URL scheme.
Variables ¶
This section is empty.
Functions ¶
func WithAllowCIDR ¶
func WithAllowCIDR(net ...*net.IPNet) interface { HTTPEndpointOption TCPEndpointOption TLSEndpointOption }
Add the provided net.IPNet to the [CIDRRestriction].Allowed list.
func WithAllowCIDRString ¶
func WithAllowCIDRString(cidr ...string) interface { HTTPEndpointOption TCPEndpointOption TLSEndpointOption }
Add the provided CIDRS to the [CIDRRestriction].Allowed list.
func WithDenyCIDR ¶
func WithDenyCIDR(net ...*net.IPNet) interface { HTTPEndpointOption TCPEndpointOption TLSEndpointOption }
Add the provided net.IPNet to the [CIDRRestriction].Denied list.
func WithDenyCIDRString ¶
func WithDenyCIDRString(cidr ...string) interface { HTTPEndpointOption TCPEndpointOption TLSEndpointOption }
Add the provided CIDRS to the [CIDRRestriction].Denied list.
func WithDomain ¶
func WithDomain(name string) interface { HTTPEndpointOption TLSEndpointOption }
WithDomain sets the domain for this edge.
func WithForwardsTo ¶
func WithForwardsTo(meta string) interface { HTTPEndpointOption LabeledTunnelOption TCPEndpointOption TLSEndpointOption }
WithForwardsTo sets the ForwardsTo string for this tunnel. This can be veiwed via the API or dashboard.
func WithHTTPHandler ¶
func WithHTTPHandler(h http.Handler) interface { HTTPEndpointOption TLSEndpointOption TCPEndpointOption LabeledTunnelOption }
WithHTTPHandler adds the provided credentials to the list of basic authentication credentials.
func WithHTTPServer ¶
func WithHTTPServer(srv *http.Server) interface { HTTPEndpointOption TLSEndpointOption TCPEndpointOption LabeledTunnelOption }
WithHTTPServer adds the provided credentials to the list of basic authentication credentials.
func WithMetadata ¶
func WithMetadata(meta string) interface { HTTPEndpointOption TCPEndpointOption TLSEndpointOption LabeledTunnelOption }
WithMetadata sets the opaque metadata string for this tunnel.
func WithMutualTLSCA ¶
func WithMutualTLSCA(certs ...*x509.Certificate) interface { HTTPEndpointOption TLSEndpointOption }
WithMutualTLSCA adds a list of x509.Certificate's to use for mutual TLS authentication. These will be used to authenticate client certificates for requests at the ngrok edge.
func WithProxyProto ¶
func WithProxyProto(version ProxyProtoVersion) interface { HTTPEndpointOption TCPEndpointOption TLSEndpointOption }
WithProxyProto sets the PROXY protocol version for connections over this tunnel.
Types ¶
type HTTPEndpointOption ¶
type HTTPEndpointOption interface {
ApplyHTTP(cfg *httpOptions)
}
func WithBasicAuth ¶
func WithBasicAuth(username, password string) HTTPEndpointOption
WithBasicAuth adds the provided credentials to the list of basic authentication credentials.
func WithCircuitBreaker ¶
func WithCircuitBreaker(ratio float64) HTTPEndpointOption
WithCircuitBreaker sets the 5XX response ratio at which the ngrok edge will stop sending requests to this tunnel.
func WithCompression ¶
func WithCompression() HTTPEndpointOption
WithCompression enables gzip compression.
func WithOAuth ¶
func WithOAuth(provider string, opts ...OAuthOption) HTTPEndpointOption
WithOAuth configures this edge with the the given OAuth provider. Overwrites any previously-set OAuth configuration.
func WithOIDC ¶
func WithOIDC(issuerURL string, clientID string, clientSecret string, opts ...OIDCOption) HTTPEndpointOption
WithOIDC configures this edge with the the given OIDC provider. Overwrites any previously-set OIDC configuration.
func WithRemoveRequestHeader ¶
func WithRemoveRequestHeader(name string) HTTPEndpointOption
WithRemoveRequestHeader removes a header from requests to this edge.
func WithRemoveResponseHeader ¶
func WithRemoveResponseHeader(name string) HTTPEndpointOption
WithRemoveResponseHeader removes a header from responses from this edge.
func WithRequestHeader ¶
func WithRequestHeader(name, value string) HTTPEndpointOption
WithRequestHeader adds a header to all requests to this edge.
func WithResponseHeader ¶
func WithResponseHeader(name, value string) HTTPEndpointOption
WithRequestHeader adds a header to all responses coming from this edge.
func WithScheme ¶
func WithScheme(scheme Scheme) HTTPEndpointOption
WithScheme sets the scheme for this edge.
func WithWebhookVerification ¶
func WithWebhookVerification(provider string, secret string) HTTPEndpointOption
WithWebhookVerification configures webhook vericiation for this edge.
func WithWebsocketTCPConversion ¶
func WithWebsocketTCPConversion() HTTPEndpointOption
WithWebsocketTCPConversion enables the websocket-to-tcp converter.
type LabeledTunnelOption ¶
type LabeledTunnelOption interface {
ApplyLabeled(cfg *labeledOptions)
}
func WithLabel ¶
func WithLabel(label, value string) LabeledTunnelOption
WithLabel adds a label to this tunnel's set of label, value pairs.
type OAuthOption ¶
type OAuthOption func(cfg *oauthOptions)
func WithAllowOAuthDomain ¶
func WithAllowOAuthDomain(domain ...string) OAuthOption
Append email domains to the list of allowed domains.
func WithAllowOAuthEmail ¶
func WithAllowOAuthEmail(addr ...string) OAuthOption
Append email addresses to the list of allowed emails.
func WithOAuthScope ¶
func WithOAuthScope(scope ...string) OAuthOption
Append scopes to the list of scopes to request.
type OIDCOption ¶
type OIDCOption func(cfg *oidcOptions)
func WithAllowOIDCDomain ¶
func WithAllowOIDCDomain(domain ...string) OIDCOption
Append email domains to the list of allowed domains.
func WithAllowOIDCEmail ¶
func WithAllowOIDCEmail(addr ...string) OIDCOption
Append email addresses to the list of allowed emails.
func WithOIDCScope ¶
func WithOIDCScope(scope ...string) OIDCOption
Append scopes to the list of scopes to request.
type ProxyProtoVersion ¶
type ProxyProtoVersion int32
ProxyProtoVersion is a valid PROXY protocol version
type TCPEndpointOption ¶
type TCPEndpointOption interface {
ApplyTCP(cfg *tcpOptions)
}
func WithRemoteAddr ¶
func WithRemoteAddr(addr string) TCPEndpointOption
Set the TCP address to request for this edge.
type TLSEndpointOption ¶
type TLSEndpointOption interface {
ApplyTLS(cfg *tlsOptions)
}
func WithTermination ¶
func WithTermination(certPEM, keyPEM []byte) TLSEndpointOption
WithTermination sets the key and certificate in PEM format for TLS termination at the ngrok edge.
type Tunnel ¶
type Tunnel interface {
// contains filtered or unexported methods
}
Tunnel is a marker interface for options that can be used to start tunnels. It should not be implemented outside of this module.
func HTTPEndpoint ¶
func HTTPEndpoint(opts ...HTTPEndpointOption) Tunnel
Construct a new set of HTTP tunnel options.
func LabeledTunnel ¶
func LabeledTunnel(opts ...LabeledTunnelOption) Tunnel
Construct a new set of Labeled tunnel options.
func TCPEndpoint ¶
func TCPEndpoint(opts ...TCPEndpointOption) Tunnel
Construct a new set of HTTP tunnel options.
func TLSEndpoint ¶
func TLSEndpoint(opts ...TLSEndpointOption) Tunnel
Construct a new set of HTTP tunnel options.
Source Files ¶
- basic_auth.go
- cidr_restrictions.go
- circuit_breaker.go
- common.go
- compression.go
- domain.go
- forwards_to.go
- http.go
- http_handler.go
- http_headers.go
- labeled.go
- metadata.go
- mutual_tls.go
- oauth.go
- oidc.go
- proxy_proto.go
- scheme.go
- tcp.go
- tls.go
- tls_termination.go
- tunnel_config.go
- webhook_verification.go
- websocket_tcp_conversion.go