Skip to content

Latest commit

 

History

History
102 lines (80 loc) · 4.45 KB

File metadata and controls

102 lines (80 loc) · 4.45 KB
eyebrow Docs · API
lede HttpsTransport — implements ClientTransportInterface for opc.https://, plugs into ClientBuilder::setTransport(), and orchestrates the HTTPS round-trips.
see_also
href meta
./encoding-strategies.md
3 min
href meta
./http-client.md
3 min
href meta
../concepts/how-it-works.md
5 min
prev
label href
Encodings
../concepts/encodings.md
next
label href
Encoding strategies
./encoding-strategies.md

HttpsTransport

Fully qualified name: PhpOpcua\Client\ExtTransportHttps\HttpsTransport. Implements PhpOpcua\Client\Transport\ClientTransportInterface.

Constructor

Backend that performs the POSTs. CurlHttpClient is shipped; PSR-18 wrappers are user-supplied.

The wire encoding. v4.4 ships BinaryHttpsEncoding (production-ready, see HTTPS Binary status) and JsonHttpsEncoding (foundation shipped, see HTTPS JSON status). XML SOAP and legacy SOAP/HTTP are roadmap.

opc.https://host:port/path or https://host:port/path. The constructor normalises opc.https:// to https://. Invalid scheme raises HttpsTransportException.

Per-request hard upper bound passed to the HTTP client.

Optional PSR-3 logger. Defaults to NullLogger.

Optional PSR-14 dispatcher. When null, events are not emitted.

Methods inherited from ClientTransportInterface

No-op — HTTPS is stateless. Throws ConnectionException if close() was called.

If the frame starts with HEL, asks the encoding for a fake ACK and stores it; otherwise encodes the request via encodeRequest() and POSTs.

Returns the pending fake ACK if any, then the decoded HTTP response (re-wrapped in a synthetic UA-TCP frame).

Cap for the re-framed response size. Triggers ProtocolException on receive() when exceeded.

Releases the HTTP client. Idempotent.

true until close() is called.

Returns a fresh HttpsTransport sharing the same HTTP client / encoding / endpoint, for use as the discovery probe.

Always true — TLS is the secure channel, the core skips OpenSecureChannel.

Events dispatched

When a dispatcher is supplied:

  • HttpsRequestSent — before the POST (url, contentType, bodyLength).
  • HttpsResponseReceived — after a 2xx response, before decoding (url, statusCode, bodyLength).
  • HttpsRequestFailed — on network failure (statusCode=0) or non-2xx (statusCode=<actual>), with the originating exception in cause.

Logging

  • INFO — none in the default path (HTTPS is too verbose; emit at application level if needed).
  • WARNING — non-2xx response; event-dispatcher throw caught.
  • ERRORHttpsRequestException from the HTTP backend.

The transport owns mutable buffers (pendingAck, pendingResponse); use one instance per Client.