useragent

package
v0.69.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: Apache-2.0 Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package useragent sets the vMCP User-Agent on requests vMCP sends to its backends, so backend proxies can attribute those requests to vMCP instead of seeing Go's default Go-http-client agent.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Value

func Value() string

Value returns the User-Agent vMCP sends to backends.

Types

type RoundTripper

type RoundTripper struct {
	// contains filtered or unexported fields
}

RoundTripper sets the vMCP User-Agent on requests that carry none.

A User-Agent already on the request is kept. Place this stage inside (closer to the wire than) the header-forward stage so a User-Agent an operator forwards through passthroughHeaders or headerForward reaches the backend unchanged.

func NewRoundTripper

func NewRoundTripper(base http.RoundTripper) *RoundTripper

NewRoundTripper wraps base with a stage that sets the vMCP User-Agent.

func (*RoundTripper) CloseIdleConnections

func (t *RoundTripper) CloseIdleConnections()

CloseIdleConnections forwards to the wrapped RoundTripper so it reaches the concrete *http.Transport at the bottom of the chain.

func (*RoundTripper) RoundTrip

func (t *RoundTripper) RoundTrip(req *http.Request) (*http.Response, error)

RoundTrip implements http.RoundTripper. It clones the request before setting the header, per the RoundTripper contract.

Jump to

Keyboard shortcuts

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