dart-sdk/sdk
rnewquist 2917c1cb8f [io/http] Add a HTTP Client parameter on WebSocket.connect to allow a custom HTTP Client for web socket connections.
The WebSocket abstract class was changed to allow an optional parameter called customClient that takes in a HTTPClient and passes it to the WebSocket Implementation.
The WebSocket implementation takes the customClient, checks if its null, if its not null, it uses the customClient in place of the static HTTPClient that the WebSocket Implementation offers.
This custom client does not override the static HTTPClient, so all previous functionality remains the same when the customClient is not present.

TEST=testStaticClientUserAgentStaysTheSame() in web_socket_test.dart in standalone_2/standalone
TEST=new SecurityConfiguration(secure: true).runTests(); in web_socket_error_test.dart and web_socket_test.dart in standalone_2/standalone

Bug: https://github.com/dart-lang/sdk/issues/34284

Closes https://github.com/dart-lang/sdk/pull/46040
https://github.com/dart-lang/sdk/pull/46040

GitOrigin-RevId: 58fed38baa606a8a492d3729190afa5009cc2409
Change-Id: I042b1e3fa7a4effed076c0deeec1f86af0dfe26d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/200262
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2021-09-15 18:06:42 +00:00
..
bin Deprecate top level pub. 2021-08-24 08:34:58 +00:00
lib [io/http] Add a HTTP Client parameter on WebSocket.connect to allow a custom HTTP Client for web socket connections. 2021-09-15 18:06:42 +00:00
api_readme.md Update the API docs readme 2020-01-16 21:23:09 +00:00
BUILD.gn Deprecate top level pub. 2021-08-24 08:34:58 +00:00