WebProxyCarrier class

Describes a web proxy carrier: an HTTPS relay page, which carries traffic of a web proxy and must be loaded by the application as the top-level document of a hidden web view. Before loading the page, the application must arrange for an object named carrier.bridge_object_name to be defined in the top-level document whenever its origin is exactly carrier.origin, and in no other document or frame. The object must be read-only and must have two members: a method postMessage(value), which passes an ArrayBuffer or a typed array to processWebProxyCarrierMessage as webProxyCarrierMessageBinary, passes a string as webProxyCarrierMessageText, and rejects any other value; and a property onmessage, which the page sets to a function. The application delivers data to the page by calling that function with an object {data: value}, where value is an ArrayBuffer for binary data and a string for text. Each carrier needs its own web view

Inheritance
Available extensions
Annotations
  • @immutable

Constructors

WebProxyCarrier({required int id, required int proxyId, required String url, required String origin, required String pathPrefix, required String bridgeObjectName, required bool isTemporary})
const

Properties

bridgeObjectName → String
bridgeObjectName Name of the object to define in the top-level document; currently, always "TelegramWebProxy"
final
hashCode → int
The hash code for this object.
no setteroverride
id → int
id Unique identifier of the carrier
final
isTemporary → bool
isTemporary True, if the carrier is needed only to test the proxy and will be closed after the test. The application may refuse to open such carriers, for example, to avoid creating a web view for every saved proxy
final
origin → String
origin Origin of the relay page, for example, "https://proxy.example.com". The web view must not be allowed to navigate to another origin
final
pathPrefix → String
pathPrefix The only path prefix on carrier.origin from which the page may load resources or to which it may send requests, for example, "/" or "/relay/"
final
proxyId → int
proxyId Identifier of the added proxy that uses the carrier; 0 if the carrier is used by pingProxy or testProxy
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
url → String
url The HTTPS URL to load. The URL contains the capability for the proxy and a fragment, which must be kept; the URL must never be logged or shown to the user
final

Methods

copyWith({int? id, int? proxyId, String? url, String? origin, String? pathPrefix, String? bridgeObjectName, bool? isTemporary}) → WebProxyCarrier

Available on WebProxyCarrier, provided by the WebProxyCarrierExtensions extension

getConstructor() → String
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, dynamic>
override
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
override

Static Methods

fromJson(Map<String, dynamic>? json) → WebProxyCarrier?

Constants

constructor → const String