Settings that control how Pkl talks to HTTP(S) servers.
Configuration of the HTTP proxy to use.
Replace outbound requests from one URL with another URL.
Each key describes the prefix of a request, and each value describes the replacement prefix.
This can be useful for setting up mirroring of packages, which are fetched over HTTPS.
In the case of multiple matches, the longest prefix is used.
The URL hostname is case-insensitive.
A replacement only happens once when resolving URLs. Therefore, the first replacement is the final URL that is used for the outbound request.
In the following example, an original request for https://pkg.pkl-lang.org/my/pkg@1.0.0 is replaced with https://my.internal.mirror/my/pkg@1.0.0.
https://pkg.pkl-lang.org/my/pkg@1.0.0
https://my.internal.mirror/my/pkg@1.0.0
This does not affect 3XX status code redirect following.
3XX
Example:
rewrites { ["https://pkg.pkl-lang.org/"] = "https://my.internal.mirror/" }
Rewrite targets must satisfy the following:
http://
https://
/
An rewrite target should also not contain a query string or fragment component (not schematically enforced).
Returns the class of this.
this
Returns a string representation of this.
This method is used to convert the values of string interpolation expressions to strings.
Returns this |> transform if this is non-null, and null otherwise.
this |> transform
null
This method is the complement of the ?? operator and the equivalent of an Option type's map and flatMap methods.
??
Option
map
flatMap
Tells if this object has a property with the given name.
name
Returns the value of the property with the given name.
Throws if a property with this name does not exist.
Returns null if a property with this name does not exist.
Converts this object to a Dynamic object.
Dynamic
Converts this object to a Map.
Map
Settings that control how Pkl talks to HTTP(S) servers.