HttpProxy

org.llm4s.http.HttpProxy
See theHttpProxy companion object
@Stable
final case class HttpProxy

An outbound HTTP proxy every llm4s HTTP client routes through: the llm4s.http.proxy block.

llm4s.http.proxy {
 url           = "http://proxy.corp:3128"
 username      = ${?LLM4S_PROXY_USER}
 password      = ${?LLM4S_PROXY_PASSWORD}
 nonProxyHosts = ["localhost", "*.internal"]
}

The proxy is an HTTP proxy: plain-http requests go to it in absolute form, https ones through a CONNECT tunnel. Proxy authentication is HTTP Basic; PAC files and Kerberos/NTLM are not supported.

nonProxyHosts lists the hosts reached directly. An entry is a host name or address matched exactly (localhost), a domain suffix (*.internal or .internal, which match internal itself too), a prefix (10.*), or * for every host; matching ignores case. A CIDR range is not supported. The default is the loopback addresses (HttpProxy.DefaultNonProxyHosts); setting the list replaces it.

The password is redacted in toString. Build one with HttpProxy.apply or HttpProxy.fromUrl and adjust it with the with* setters; the constructor is private, so a new field never breaks a caller.

Value parameters

host

the proxy's host name or address

nonProxyHosts

the hosts reached directly, not through the proxy

password

the password for proxy authentication; never printed

port

the proxy's port

username

the user name for proxy authentication, if the proxy requires it

Attributes

Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def bypasses(targetHost: String): Boolean

true when targetHost is reached directly: it matches an entry of nonProxyHosts.

true when targetHost is reached directly: it matches an entry of nonProxyHosts.

Attributes

def credentials: Option[(String, String)]

The user name and password, when both are set: the proxy's Basic credentials.

The user name and password, when both are set: the proxy's Basic credentials.

Attributes

override def toString: String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
Any
def withHost(host: String): HttpProxy
def withNonProxyHosts(nonProxyHosts: Seq[String]): HttpProxy
def withPassword(password: String): HttpProxy
def withPassword(password: Option[String]): HttpProxy
def withPort(port: Int): HttpProxy
def withUsername(username: String): HttpProxy
def withUsername(username: Option[String]): HttpProxy

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product