mORMot2 DailyDaily read of upstream commits

Proxy routing matures, with a WebSocket subclass trap fixed

This edition extends proxy discovery and bypass handling across socket and REST clients, then fixes redirect routing, proxy credentials, socket layers and URI validation. It also adds option-aware WebSocket factories, with the final build repairing a derived-class regression in their legacy overloads. Direct callers of GetProxyForUri must now pass a TUri instead of RawUtf8.

TL;DR

  • GetProxyForUri now accepts TUri instead of RawUtf8, so direct callers require a source migration.
  • HTTP_PROXY, HTTPS_PROXY, NO_PROXY, Windows bypass lists and REST ProxyName now feed the socket client route selection.
  • Cross-origin redirects, proxy credential changes and non-TCP reconnects now select the correct route and socket layer.
  • New THttpClientWebSockets.WebSocketsConnect overloads accept TUri and THttpRequestExtendedOptions; build 2.4.17462 fixes their legacy derived-class dispatch.
  • RemoveMagicFromJson removes JSON_BASE64_MAGIC from JSON string prefixes without changing ordinary strings.
  • Land on build 2.4.17462 and avoid stopping on builds 2.4.17450 through 2.4.17461.

Upgrade advice

Land on final build 2.4.17462. Builds 2.4.17450–2.4.17461 contain the TUri/proxy/WebSocket transition before later redirect, socket-layer, credential, parser and subclass fixes. Before compiling, grep for direct GetProxyForUri calls and replace RawUtf8 arguments with a parsed TUri; then test proxy bypass, authenticated proxies, cross-origin redirects and WebSocket subclasses.

Build2.4.17433 → 2.4.17462
Commits27
Lines+1070 -395
Read6 min

27 of 27 entries · 27 commits upstream

Stories
# Entry Category Units
1 High GetProxyForUri now requires a parsed TUri The public GetProxyForUri parameter changes from RawUtf8 to TUri. A new GetSystemProxyUri(TUri, proxy, bypass, temp) overload is added, while the RawUtf8 compatibility wrapper remains for GetSystemProxyUri. Breaking changes mormot.net.client+1 fb71148d+90-83

net: favor TUri input for proxy calculation

Impact

Direct GetProxyForUri('https://...') calls no longer compile in Delphi or FPC. Internal callers avoid reparsing and use one normalized URI for proxy and bypass decisions.

Migration required

Grep for GetProxyForUri calls, parse the text into a TUri with TUri.From, and pass that record to GetProxyForUri.

Public API

  • GetProxyForUrisignature-changed
  • GetSystemProxyUri(TUri, RawUtf8, RawUtf8, TUri)added

Arnaud Bouchez · 13:01 UTC · view the commit on GitHub →

2 High Socket clients recalculate bypass and proxy state after cross-origin redirects THttpClientSocket adds SetTunnelForUri and SameTunnelForUri. OpenOptions uses the configured ProxyByPass list, SameOpenOptions compares the effective route, and cross-origin redirect reconnects recalculate Tunnel before OpenBind. Fixes mormot.net.client 162838d7+28-17

net: fixed THttpClientSocket proxy support

Impact

Proxy bypass rules now affect initial socket connections, and a redirect to another origin no longer keeps the first origin's direct or proxy route.

Public API

  • THttpClientSocket proxy routingbehaviour-changed

Arnaud Bouchez · 13:11 UTC · view the commit on GitHub →

3 High Redirects now reconnect when their effective proxy route changes THttpClientSocket extracts SameTunnelForUri and includes it in SameOpenOptions. Redirect handling now closes and reopens when the destination resolves to a different direct or proxied route, and HTTP_SCHEME accepts usUndefined records built by field assignment. Fixes mormot.net.client+1 1b254474+24-15

net: some other proxy fixes

Impact

A redirect can no longer reuse a socket connected through the wrong proxy path, avoiding requests being sent to an incompatible peer or tunnel.

Public API

  • HTTP_SCHEMEbehaviour-changed

Arnaud Bouchez · 14:16 UTC · view the commit on GitHub →

4 High Legacy WebSocket factories now preserve the requested derived client class THttpClientWebSockets.LegacyWebSocketsConnect is now a protected class function and calls WebSocketsConnect through its current class. TPrivateRelay.NewServerClient uses an as cast after calling TServerClient.WebSocketsConnect. Fixes mormot.net.relay+1 754f9f1f+13-9

net: fixed THttpClientWebSockets.WebSocketsConnect legacy overloads

Impact

Legacy overloads invoked on a THttpClientWebSockets descendant now construct that descendant. Builds 2.4.17454–2.4.17461 could return the parent class and fail a relay cast or omit descendant state.

Public API

  • THttpClientWebSockets.WebSocketsConnect legacy overloadsbehaviour-changed

Arnaud · 20:50 UTC · view the commit on GitHub →

5 High Reconnects retain their socket layer and redirects reject non-HTTP schemes THttpClientSocket retry and TCrtSocket.ConnectUri, ReOpen and OpenFrom now pass the stored TNetLayer into OpenBind. Redirect handling refuses a Location whose parsed TUri scheme is outside HTTP_SCHEME. Fixes mormot.net.client+1 ba80a667+15-7

net: fixed OpenBind() socket layer usage

Impact

UDP and Unix-domain sockets no longer silently reopen as TCP, and an HTTP redirect cannot switch the client into an unsupported scheme while retaining a misleading 3xx flow.

Public API

  • TCrtSocket.ReOpenbehaviour-changed
  • TCrtSocket.OpenFrombehaviour-changed

Arnaud Bouchez · 15:44 UTC · view the commit on GitHub →

6 Medium Malformed URI authorities are rejected and proxy ports compare consistently TUri.FromBuffer now clears Server and fails on empty or whitespace-only ports and invalid authority tails. THttpClientSocket.OpenBind supplies port 80 or 443 when comparing a destination with its proxy tunnel. Fixes mormot.net.client+2 22cf7d7d+102-22

net: enhanced TUri parser

Impact

Invalid endpoint text no longer leaves a partially usable TUri, and default-port proxy routes are less likely to be mistaken for a different destination.

Public API

  • TUri.FromBufferbehaviour-changed

Arnaud Bouchez · 16:25 UTC · view the commit on GitHub →

7 Medium Proxy reuse now accounts for credentials and exposes WebSocket errors THttpClientSocket.SameTunnelForUri compares proxy User and Password as well as server, port and TLS. TCrtSocket.OpenBind clears fProxyUrl and compares the complete tunnel, while the TUri WebSocketsConnect overload gains an optional aErrorMessage output. Fixes mormot.net.client+3 7b276456+23-12

net: another set of proxy fixes

Impact

Changing credentials for the same proxy endpoint now forces the correct route state instead of reusing a connection authenticated with stale credentials.

Public API

  • THttpClientWebSockets.WebSocketsConnect(TUri, ...)signature-changed

Arnaud Bouchez · 16:04 UTC · view the commit on GitHub →

8 Medium Async connection destruction makes unfinished writes explicitly abortive TPollAsyncConnection.Destroy disables SO_LINGER for a normal close when fWr is empty, but sets zero linger before closing when the userspace write buffer still contains data, causing an immediate reset and discard. Fixes mormot.net.async ab20d3ec+6-3

net: tuned TPollAsyncConnection closure

Impact

Connection teardown no longer ambiguously attempts to close with unsent buffered output; peers receive an abortive close when data cannot be completed. Normal completed writes retain asynchronous close behavior.

Public API

  • TPollAsyncConnection.Destroybehaviour-changed

Arnaud Bouchez · 08:40 UTC · view the commit on GitHub →

9 Medium WebSocket clients gain URI- and option-aware connection factories THttpClientWebSockets adds WebSocketsConnect overloads for TUri plus THttpRequestExtendedOptions and for URI text plus an options pointer. Existing host/port and URI overloads are retained through a legacy helper. New features mormot.net.ws.client 04fdbef9+86-29

net: new THttpClientWebSockets.WebSocketsConnect overloads

Impact

WebSocket connections can now share proxy, bypass, TLS and timeout configuration with HTTP clients. Do not stop on this introducing build because the legacy subclass dispatch is fixed only in build 2.4.17462.

Public API

  • THttpClientWebSockets.WebSocketsConnect(TUri, var THttpRequestExtendedOptions, ...)added
  • THttpClientWebSockets.WebSocketsConnect(RawUtf8, TWebSocketProtocol, PHttpRequestExtendedOptions, ...)added

Arnaud Bouchez · 15:06 UTC · view the commit on GitHub →

10 Medium JSON BLOB magic prefixes can now be stripped from serialized text mormot.core.json adds RemoveMagicFromJson(var RawUtf8). It scans quoted JSON strings, removes a leading UTF-8 JSON_BASE64_MAGIC marker, compacts unique strings in place and copies shared strings before modification. New features mormot.core.json e82e1227+76-2

core: new RemoveMagicFromJson() function

Impact

Applications can convert mORMot BLOB-marked JSON into plain base64 JSON without reparsing the document; existing serialization is unchanged until the function is called.

Public API

  • RemoveMagicFromJsonadded

Arnaud Bouchez · 19:17 UTC · view the commit on GitHub →

11 Medium NO_PROXY domain and IP matching becomes a reusable public helper mormot.net.client adds NoProxyMatch. It handles comma-delimited rules, optional leading dots, exact hosts, subdomains, IPv4 and IPv6 literals, and a standalone wildcard, with regression tests. New features mormot.net.client+1 530cb3f0+71-7

net: new NoProxyMatch() parsing function

Impact

Applications and the HTTP client can apply consistent NO_PROXY semantics without duplicating domain-suffix matching code.

Public API

  • NoProxyMatchadded

Arnaud Bouchez · 12:18 UTC · view the commit on GitHub →

12 Medium WinHTTP proxy discovery applies the system bypass list GetWinProxyForUri wraps WinHttpGetProxyInfo, converts its URL and Bypass fields, and clears the selected proxy when ProxyByPassMatch accepts the URI host. WinHTTP security error formatting is also simplified. New features mormot.lib.winhttp+1 fa71c244+40-17

net: enhanced WinHttp API support for GetProxyForUri()

Impact

Windows clients using automatic system proxy discovery now connect directly to destinations listed in the Internet Options bypass list.

Public API

  • GetWinProxyForUriadded

Arnaud Bouchez · 12:04 UTC · view the commit on GitHub →

13 Medium Socket proxy selection gains explicit bypass-list support GetSystemProxyUri receives a bypass argument and excludes matching hosts before choosing a forced, global or discovered proxy. THttpClientSocket passes THttpRequestExtendedOptions.ProxyByPass into that decision. New features mormot.net.client 0e03d2c8+17-12

net: ProxyByPass support for THttpClientSocket

Impact

Socket-based HTTP clients can now honor configured Windows-style bypass masks instead of sending every non-local destination through the proxy.

Public API

  • GetSystemProxyUrisignature-changed
  • THttpClientSocket proxy bypassbehaviour-changed

Arnaud Bouchez · 11:47 UTC · view the commit on GitHub →

14 Medium Socket proxy discovery now honors NO_PROXY on Windows and POSIX GetProxyForUri reads NO_PROXY after selecting HTTP_PROXY or HTTPS_PROXY and clears the proxy when NoProxyMatch accepts the parsed host. The same path is compiled on Windows and POSIX. New features mormot.net.client+1 2e0bdd2b+22-4

net: NO_PROXY env variable support for GetProxyForUri()

Impact

Existing environments that define NO_PROXY may now send matching destinations directly instead of through the configured proxy, changing network reachability as intended by the environment.

Worth a look

Check deployed NO_PROXY values and test that required internal hosts bypass the proxy while external hosts still use it.

Public API

  • GetProxyForUribehaviour-changed

Arnaud Bouchez · 12:22 UTC · view the commit on GitHub →

15 Medium TUri can normalize WebSocket schemes to HTTP for proxy lookup TUri.URI and TUri.ServerPort gain an optional NormalizeToHttp parameter. When true, ws and wss records are emitted as http and https while preserving server, port and address. New features mormot.net.sock 6e58a86c+10-9

net: new NormalizeToHttp optional parameter to TUri.ServerPort/Uri methods

Impact

Proxy APIs can query HTTP proxy configuration for WebSocket endpoints without losing the original scheme in normal TUri output. Existing calls remain compatible through the default false value.

Public API

  • TUri.URIsignature-changed
  • TUri.ServerPortsignature-changed

Arnaud Bouchez · 12:48 UTC · view the commit on GitHub →

16 Medium REST socket clients now retain explicitly configured proxy settings TRestHttpClientSocket.InternalOpen only forces THttpRequestExtendedOptions.Proxy to 'none' when Proxy is empty. Constructor-supplied ProxyName and ProxyByPass values therefore reach THttpClientSocket.OpenOptions. New features mormot.rest.http.client 1f291195+5-5

rest: ProxyName support for TRestHttpClientSocket

Impact

REST socket clients can use an explicit proxy for the first time; deployments that already supplied these previously ignored parameters will now change their network route.

Worth a look

If TRestHttpClientSocket constructors already receive ProxyName or ProxyByPass, verify the now-active route and authentication in staging.

Public API

  • TRestHttpClientSocket proxy parametersbehaviour-changed

Arnaud Bouchez · 09:59 UTC · view the commit on GitHub →

17 Low Automatic PeerCache selection ignores inactive interfaces THttpPeerCacheSettings.GuessInterface adds mafUpOnly when no interface name is specified and reports that no local active interface was found. An explicitly named interface may still be down. Fixes mormot.net.server 2afaac27+8-8

net: automatic PeerCache selection require an "up" interface

Impact

Automatic PeerCache startup no longer selects a disconnected adapter and derives unusable addressing from it; explicit interface selection keeps its prior behavior.

Public API

  • THttpPeerCacheSettings.GuessInterfacebehaviour-changed

Arnaud Bouchez · 09:44 UTC · view the commit on GitHub →

18 Low Windows-style proxy bypass masks get a dedicated matcher mormot.net.client adds ProxyByPassMatch for semicolon-delimited, case-insensitive host masks. It implements wildcard matching and the Windows <local> rule for names without a dot. New features mormot.net.client d916140c+82-2

net: new ProxyByPassMatch() parsing function

Impact

Applications and later socket-client code can evaluate the same bypass syntax used by Windows proxy settings.

Public API

  • ProxyByPassMatchadded

Arnaud Bouchez · 11:38 UTC · view the commit on GitHub →

19 Low Tunnel tests report connection state and expose flag text mormot.net.tunnel adds ToText(TTunnelLocalFlags). TunnelSocket test sends now log thread, processing, flags, local port and remote port on failure, and mormot.net.sock documents all SetLinger value ranges. New features mormot.net.sock+2 fbcc175f+41-11

test: added more context to Tunnel coverage

Impact

Production tunnel behavior is unchanged; failures gain enough state for diagnosis and applications may reuse the new flag formatter.

Public API

  • ToText(TTunnelLocalFlags)added

Arnaud Bouchez · 08:41 UTC · view the commit on GitHub →

20 Low URI scheme names and default ports become public constants mormot.net.sock publishes SCHEME_TEXT and SCHEME_PORT and replaces the private lookup arrays throughout TUri. The same commit removes a duplicate fProxyAuthHeader reset and extends malformed-port tests. New features mormot.net.client+2 7dddd3ec+25-15

net: published SCHEME_TEXT/SCHEME_PORT constants

Impact

Application code can reuse mORMot's canonical scheme text and port mapping; existing URI behavior is otherwise unchanged by this commit.

Public API

  • SCHEME_TEXTadded
  • SCHEME_PORTadded

Arnaud Bouchez · 16:37 UTC · view the commit on GitHub →

21 Low TUri.FromScheme can initialize the resource address in one call TUri.FromScheme gains an optional aAddress parameter, trims one leading slash and stores the result in Address. The public WS_SCHEME array maps a Boolean TLS flag to usWs or usWss. New features mormot.net.sock 9dcadeec+12-4

net: enhanced TUri.FromScheme()

Impact

Callers can build complete WebSocket or HTTP TUri values without assigning Address separately; existing calls remain source compatible through the default argument.

Public API

  • TUri.FromSchemesignature-changed
  • WS_SCHEMEadded

Arnaud Bouchez · 15:05 UTC · view the commit on GitHub →

22 Low JSON tests and HTTP line parsing receive a non-functional cleanup RemoveMagicFromJson tests reuse precomputed magic strings, its scan comment names the SSE2 path, and THttpRequestContext.ProcessParseLine expands a Boolean expression into an explicit branch. Under the hood mormot.core.json+2 e0b8347f+29-30

core: some code cleaning with no functional change

Impact

There is no application-code or runtime behavior change; this only clarifies code and reduces repeated test setup.

Arnaud Bouchez · 19:24 UTC · view the commit on GitHub →

23 Low Async WebSocket broadcast tests synchronize with the completed upgrade TNetworkProtocols.DoTWebSocketAsyncServer replaces a dedicated broadcast thread with a RunTask-based object, Connected and Done events, an OnWebSocketConnect callback and bounded waits around each broadcast. Tests test.net.proto 836d5fff+109-47

test: rewritten TNetworkProtocols.DoTWebSocketAsyncServer

Impact

Production code is unchanged; the regression test no longer races WebSocket upgrade completion and reports a bounded failure instead of hanging indefinitely.

Arnaud Bouchez · 07:41 UTC · view the commit on GitHub →

24 Low JSON magic removal gains copy-on-write and malformed-input coverage TTestCoreProcess.EncodeDecodeJSON now covers RemoveMagicFromJson with normal, escaped, shared, empty, property-name, repeated-marker and malformed JSON inputs, including in-place buffer reuse. Tests test.core.data cd184a55+90-2

test: cover the new RemoveMagicFromJson()

Impact

Production code is unchanged; the tests document marker boundaries and protect RawUtf8 copy-on-write behavior.

Arnaud Bouchez · 19:18 UTC · view the commit on GitHub →

25 Low Expected database test failures no longer pollute exception logs External-database next-ID failure tests and SQLite batch rollback tests now bracket expected errors with TSynLog.Family.ExceptionIgnoreCurrentThread and restore the setting in finally blocks. Tests test.orm.extdb+1 d0efb516+26-15

test: hide expected exceptions

Impact

Database runtime behavior is unchanged; test output becomes quieter while preserving the same failure and rollback assertions.

Arnaud Bouchez · 09:22 UTC · view the commit on GitHub →

26 Low The wrong-password 7-Zip test no longer emits an expected exception TTestCoreCompression._7Zip temporarily sets TSynLog.Family.ExceptionIgnoreCurrentThread while checking the expected failure from an incorrect archive password, then restores the flag in finally. Tests test.core.data bfa4dec9+10-5

test: hide expected exception in TTestCoreCompression._7Zip

Impact

Production compression behavior is unchanged; automated test logs contain less expected exception noise.

Arnaud Bouchez · 10:00 UTC · view the commit on GitHub →

27 Low PeerCache tests skip cleanly when no usable network exists TNetworkProtocols._THttpPeerCache calls THttpPeerCacheSettings.GuessInterface before creating the hook and exits with a console reason when no local active interface is available. Tests test.net.proto a78c76d9+10-3

test: cleanly skip PeerCache tests if there is no network available

Impact

Production code is unchanged; offline CI and developer machines no longer report a PeerCache failure caused only by missing networking.

Arnaud Bouchez · 09:44 UTC · view the commit on GitHub →

Upstream activity commits per day · last 60 days
Commits977
Active days44/60
Busiest2026-09-30
Peak60
2026-08-15: 0 commits2026-08-16: 0 commits2026-08-17: 0 commits2026-08-18: 0 commits2026-08-19: 0 commits2026-08-20: 0 commits2026-08-21: 0 commits2026-08-22: 0 commits2026-08-23: 0 commits2026-08-24: 0 commits2026-08-25: 0 commits2026-08-26: 0 commits2026-08-27: 26 commits2026-08-28: 11 commits2026-08-29: 10 commits2026-08-30: 1 commit2026-08-31: 23 commits2026-09-01: 0 commits2026-09-02: 20 commits2026-09-03: 29 commits2026-09-04: 35 commits2026-09-05: 13 commits2026-09-06: 0 commits2026-09-07: 0 commits2026-09-08: 23 commits2026-09-09: 10 commits2026-09-10: 17 commits2026-09-11: 23 commits2026-09-12: 14 commits2026-09-13: 9 commits2026-09-14: 7 commits2026-09-15: 4 commits2026-09-16: 24 commits2026-09-17: 26 commits2026-09-18: 21 commits2026-09-19: 59 commits2026-09-20: 13 commits2026-09-21: 5 commits2026-09-22: 34 commits2026-09-23: 17 commits2026-09-24: 57 commits2026-09-25: 22 commits2026-09-26: 26 commits2026-09-27: 0 commits2026-09-28: 2 commits2026-09-29: 19 commits2026-09-30: 60 commits2026-10-01: 26 commits2026-10-02: 30 commits2026-10-03: 32 commits2026-10-04: 15 commits2026-10-05: 1 commit2026-10-06: 26 commits2026-10-07: 37 commits2026-10-08: 27 commits2026-10-09: 35 commits2026-10-10: 33 commits2026-10-11: 9 commits2026-10-12: 11 commits2026-10-13: 35 commits
2026-08-152026-10-13