fireblazer

package
v0.0.0-...-061cd6f Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GetClient = sync.OnceValue(func() *http.Client {

	return &http.Client{
		Transport: &http3.Transport{
			EnableDatagrams: true,
			TLSClientConfig: &tls.Config{
				InsecureSkipVerify: true,

				ServerName: "googleapis.com",
				NextProtos: []string{http3.NextProtoH3},
			},
			Dial: func(ctx context.Context, addr string, tlsCfg *tls.Config, cfg *quic.Config) (*quic.Conn, error) {
				hostAddr, _ := net.ResolveUDPAddr("udp4", "0.0.0.0:0")
				listener, err := net.ListenUDP("udp", hostAddr)

				if err != nil {
					log.Printf("Failed to listen on local port - try raising ulimit? Error: %v", err)
				}

				var udpAddr *net.UDPAddr
				udpAddr, err = net.ResolveUDPAddr("udp", addr)

				if err != nil {
					log.Printf("Failed to resolve %s", addr)
					return nil, err
				}

				StoredResolvedAddr = udpAddr

				return quic.Dial(ctx, listener, udpAddr, tlsCfg, cfg)
			},
		},
		Timeout: 20 * time.Second,
	}
})
View Source
var GoogleApiList = []string{}/* 506 elements not displayed */
View Source
var KeyLogFile os.File
View Source
var StoredResolvedAddr *net.UDPAddr

Functions

func AppendAPIKeyToURL

func AppendAPIKeyToURL(apiUrl string, apiKey string) string

Parse query params and append the API key to it.

func MultipartAllDiscoveries

func MultipartAllDiscoveries(apiKey string, cleannames []string) (map[string]bool, error)

WIP - just need to figure out how to use this damn thing

func ReqHeaderOnly

func ReqHeaderOnly(req http.Request, useActualResolvedName bool) (*http.Response, error)

For handling errors with a retry for the connection stream itself - otherwise i'd be limited to retrying the domain name resolution / dial

func ReqWithBackoff

func ReqWithBackoff(req *http.Request, client *http.Client) (*http.Response, error)

func TestKeyServicePair

func TestKeyServicePair(apiKey string, service string, referrer string) (bool, error)

func TestKeyValidity

func TestKeyValidity(apiKey string) (bool, error)

Types

type DiscoveryItem

type DiscoveryItem struct {
	Title            string `json:"title"`
	Description      string `json:"description"`
	DiscoveryRestUrl string `json:"discoveryRestUrl"`
	Version          string `json:"version"`
	Name             string `json:"name"`
}

func GetDiscoveryEndpoints

func GetDiscoveryEndpoints() ([]DiscoveryItem, error)

This returns a list of discovery endpoints

type GapisApiItem

type GapisApiItem struct {
	Description string `json:"description"`
	Title       string `json:"title"`
	Host        string `json:"hostname"`
	Version     string `json:"majorVersion"` // This would be the preferred version from what I can tell
}

func GetEndpointsFromGapis

func GetEndpointsFromGapis() ([]GapisApiItem, error)

type GapisContainer

type GapisContainer struct {
	Apis []GapisApiItem `json:"apis"`
}

type GoogleErrorResponse

type GoogleErrorResponse struct {
	Error *struct {
		Message string `json:"message"`
	} `json:"error"`
}

Jump to

Keyboard shortcuts

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