ProxyOptions class

Configuration for the proxy helper.

By default all headers and the request body are forwarded to the upstream server. Use headers to add, replace, or remove individual headers (a null value removes that header). Set forwardHeaders or forwardBody to false to disable automatic forwarding.

ProxyOptions(
  headers: {
    'Authorization': 'Bearer INTERNAL_TOKEN', // replace
    'Cookie': null,                            // remove
  },
)

Constructors

ProxyOptions({String? method, Map<String, String?>? headers, bool forwardHeaders = true, bool forwardBody = true})
const

Properties

forwardBody bool
When true (default), the original request body is forwarded for methods that carry a body (POST, PUT, PATCH, DELETE).
final
forwardHeaders bool
When true (default), original request headers are forwarded to upstream after stripping hop-by-hop and security-sensitive headers.
final
hashCode int
The hash code for this object.
no setterinherited
headers Map<String, String?>?
Header overrides applied after the original headers are forwarded.
final
method String?
Override the HTTP method. Defaults to the original request method.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited