ProxyServer class
Binds an HttpServer on port, captures JSON responses into a RouteStore, and delegates every request to RequestForwarder.
Constructors
- ProxyServer({required Uri targetBase, required int port, bool insecure = false, bool captureErrors = false, String? filter})
- Creates a ProxyServer.
Properties
- captureErrors → bool
-
When
true, 4xx and 5xx responses are captured in addition to 2xx.final - filter → String?
-
Optional glob pattern; only paths that match are captured.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- insecure → bool
-
When
true, TLS certificate errors are ignored for HTTPS targets.final - port → int
-
Local port to listen on.
final
- routeStore → RouteStore
-
All routes captured so far (live reference — grows as requests arrive).
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- targetBase → Uri
-
The base URL of the upstream API (e.g.
https://jsonplaceholder.typicode.com).final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
start(
) → Future< void> - Starts the proxy server and prints the startup banner.
-
stop(
) → Future< int> - Stops the server and returns the number of routes captured.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited