xdaili

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2025 License: MIT, MIT Imports: 7 Imported by: 0

README

xdaili go.dev reference

Package xdaili provides a custom http.Transport and helpers for dynamic proxy service powered by xdaili.cn .

install

go get -d bitbucket.org/ai69/xdaili

Documentation

Overview

Package xdaili provides a custom http.Transport and helpers for dynamic proxy service powered by xdaili.cn .

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAuthHeader

func GetAuthHeader(order, secret string) (key string, value string)

GetAuthHeader returns a HTTP header key-value for authenticated request to use proxy provided by xdaili.

func GetProxyURL

func GetProxyURL() func(*http.Request) (*url.URL, error)

GetProxyURL returns a proxy function (for use in a Transport) to use proxy provided by xdaili.

Types

type ProxyAuthTransport

type ProxyAuthTransport struct {
	http.RoundTripper
	// contains filtered or unexported fields
}

ProxyAuthTransport wraps an http.RoundTripper with XDaili proxy authentication.

func NewProxyAuthTransport

func NewProxyAuthTransport(upstream *http.Transport, order, secret string) *ProxyAuthTransport

NewProxyAuthTransport returns a modified http.Transport with authentication required by http://www.xdaili.cn/ .

func (*ProxyAuthTransport) RoundTrip

func (ct *ProxyAuthTransport) RoundTrip(req *http.Request) (*http.Response, error)

RoundTrip adds authentication signatures in header of requests.

Jump to

Keyboard shortcuts

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