proxy

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

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

func MustNewURL(u string) *URL

MustNewURL returns new URL for the given u.

func (*URL) GetURL

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

GetURL return the underlying url.

func (*URL) IsHTTPOrHTTPS

func (u *URL) IsHTTPOrHTTPS() bool

IsHTTPOrHTTPS returns true if u is http or https

func (*URL) MarshalJSON

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

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

func (u *URL) String() string

String returns string representation of u.

func (*URL) UnmarshalJSON

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