proxy

package
v1.103.0 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2024 License: Apache-2.0 Imports: 14 Imported by: 13

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type URL

type URL struct {
	URL *url.URL
}

URL implements YAML.Marshaler and yaml.Unmarshaler interfaces for url.URL.

func MustNewURL added in v1.56.0

func MustNewURL(u string) *URL

MustNewURL returns new URL for the given u.

func (*URL) GetURL added in v1.77.1

func (u *URL) GetURL() *url.URL

GetURL return the underlying url.

func (*URL) IsHTTPOrHTTPS added in v1.58.0

func (u *URL) IsHTTPOrHTTPS() bool

IsHTTPOrHTTPS returns true if u is http or https

func (*URL) MarshalJSON added in v1.97.7

func (u *URL) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshal interface. required to properly clone internal representation of url

func (*URL) MarshalYAML

func (u *URL) MarshalYAML() (any, error)

MarshalYAML implements yaml.Marshaler interface.

func (*URL) NewDialFunc

func (u *URL) NewDialFunc(ac *promauth.Config) (func(ctx context.Context, network, addr string) (net.Conn, error), error)

NewDialFunc returns dial func for the given u and ac. Dial uses HTTP CONNECT for http and https targets https://en.wikipedia.org/wiki/HTTP_tunnel#HTTP_CONNECT_method And socks5 for socks5 targets https://en.wikipedia.org/wiki/SOCKS supports authorization and tls configuration

func (*URL) SetHeaders added in v1.79.0

func (u *URL) SetHeaders(ac *promauth.Config, req *http.Request) error

SetHeaders sets headers to req according to u and ac configs.

func (*URL) String added in v1.56.0

func (u *URL) String() string

String returns string representation of u.

func (*URL) UnmarshalJSON added in v1.97.7

func (u *URL) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaller interface. required to properly clone internal representation of url

func (*URL) UnmarshalYAML

func (u *URL) UnmarshalYAML(unmarshal func(any) error) error

UnmarshalYAML implements yaml.Unmarshaler interface.

Jump to

Keyboard shortcuts

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