Act nowcan affect a running system
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.
27 of 27 entries · 27 commits upstream
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-changedGetSystemProxyUri(TUri, RawUtf8, RawUtf8, TUri)added
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.
Upgrade recommended
Retest ProxyByPass and cross-origin redirect behavior and land on the final build, not this intermediate revision.
Public API
THttpClientSocket proxy routingbehaviour-changed
Units
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.
Upgrade recommended
Update proxy-using clients and test redirects between direct, bypassed and proxied origins.
Public API
HTTP_SCHEMEbehaviour-changed
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.
Upgrade recommended
Use build 2.4.17462 or later if legacy WebSocketsConnect overloads are called on subclasses such as TServerClient.
Public API
THttpClientWebSockets.WebSocketsConnect legacy overloadsbehaviour-changed
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.
Upgrade recommended
Prioritize this update for UDP or Unix-domain TCrtSocket reuse and test redirect rejection for non-HTTP Location values.
Public API
TCrtSocket.ReOpenbehaviour-changedTCrtSocket.OpenFrombehaviour-changed
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.
Upgrade recommended
Take the final build if URI text may come from configuration or redirects, and retest explicit and default proxy ports.
Public API
TUri.FromBufferbehaviour-changed
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.
Upgrade recommended
Authenticated-proxy users should take the final build and test credential rotation and WebSocket connection failures.
Public API
THttpClientWebSockets.WebSocketsConnect(TUri, ...)signature-changed
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
Units
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, ...)addedTHttpClientWebSockets.WebSocketsConnect(RawUtf8, TWebSocketProtocol, PHttpRequestExtendedOptions, ...)added
Units
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
Units
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
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
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-changedTHttpClientSocket proxy bypassbehaviour-changed
Units
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
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-changedTUri.ServerPortsignature-changed
Units
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
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
Units
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
Units
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
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_TEXTaddedSCHEME_PORTadded
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-changedWS_SCHEMEadded
Units
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.
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.
Units
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.
Units
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.
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.
Units
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.