deps: update undici to 5.15.0 · nodejs/node@9c2f3ce · GitHub
Skip to content

Commit 9c2f3ce

Browse files
nodejs-github-botruyadorno
authored andcommitted
deps: update undici to 5.15.0
PR-URL: #46213 Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
1 parent 9757888 commit 9c2f3ce

41 files changed

Lines changed: 7322 additions & 5525 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 101 additions & 0 deletions

deps/undici/src/docs/api/DiagnosticsChannel.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,3 +135,70 @@ diagnosticsChannel.channel('undici:client:connectError').subscribe(({ error, soc
135135
// connector is a function that creates the socket
136136
console.log(`Connect failed with ${error.message}`)
137137
})
138+
```
139+
140+
## `undici:websocket:open`
141+
142+
This message is published after the client has successfully connected to a server.
143+
144+
```js
145+
import diagnosticsChannel from 'diagnostics_channel'
146+
147+
diagnosticsChannel.channel('undici:websocket:open').subscribe(({ address, protocol, extensions }) => {
148+
console.log(address) // address, family, and port
149+
console.log(protocol) // negotiated subprotocols
150+
console.log(extensions) // negotiated extensions
151+
})
152+
```
153+
154+
## `undici:websocket:close`
155+
156+
This message is published after the connection has closed.
157+
158+
```js
159+
import diagnosticsChannel from 'diagnostics_channel'
160+
161+
diagnosticsChannel.channel('undici:websocket:close').subscribe(({ websocket, code, reason }) => {
162+
console.log(websocket) // the WebSocket object
163+
console.log(code) // the closing status code
164+
console.log(reason) // the closing reason
165+
})
166+
```
167+
168+
## `undici:websocket:socket_error`
169+
170+
This message is published if the socket experiences an error.
171+
172+
```js
173+
import diagnosticsChannel from 'diagnostics_channel'
174+
175+
diagnosticsChannel.channel('undici:websocket:socket_error').subscribe((error) => {
176+
console.log(error)
177+
})
178+
```
179+
180+
## `undici:websocket:ping`
181+
182+
This message is published after the client receives a ping frame, if the connection is not closing.
183+
184+
```js
185+
import diagnosticsChannel from 'diagnostics_channel'
186+
187+
diagnosticsChannel.channel('undici:websocket:ping').subscribe(({ payload }) => {
188+
// a Buffer or undefined, containing the optional application data of the frame
189+
console.log(payload)
190+
})
191+
```
192+
193+
## `undici:websocket:pong`
194+
195+
This message is published after the client receives a pong frame.
196+
197+
```js
198+
import diagnosticsChannel from 'diagnostics_channel'
199+
200+
diagnosticsChannel.channel('undici:websocket:pong').subscribe(({ payload }) => {
201+
// a Buffer or undefined, containing the optional application data of the frame
202+
console.log(payload)
203+
})
204+
```

deps/undici/src/docs/api/Dispatcher.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ Returns: `Boolean` - `false` if dispatcher is busy and further dispatch calls wo
192192
* **origin** `string | URL`
193193
* **path** `string`
194194
* **method** `string`
195+
* **reset** `boolean` (optional) - Default: `false` - If `false`, the request will attempt to create a long-living connection by sending the `connection: keep-alive` header,otherwise will attempt to close it immediately after response by sending `connection: close` within the request and closing the socket afterwards.
195196
* **body** `string | Buffer | Uint8Array | stream.Readable | Iterable | AsyncIterable | null` (optional) - Default: `null`
196197
* **headers** `UndiciHeaders | string[]` (optional) - Default: `null`.
197198
* **query** `Record<string, any> | null` (optional) - Default: `null` - Query string params to be embedded in the request URL. Note that both keys and values of query are encoded using `encodeURIComponent`. If for some reason you need to send them unencoded, embed query params into path directly instead.

deps/undici/src/docs/api/Fetch.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Fetch
2+
3+
Undici exposes a fetch() method starts the process of fetching a resource from the network.
4+
5+
Documentation and examples can be found on [MDN](https://developer.mozilla.org/en-US/docs/Web/API/fetch).
6+
7+
## File
8+
9+
This API is implemented as per the standard, you can find documentation on [MDN](https://developer.mozilla.org/en-US/docs/Web/API/File)
10+
11+
## FormData
12+
13+
This API is implemented as per the standard, you can find documentation on [MDN](https://developer.mozilla.org/en-US/docs/Web/API/FormData)
14+
15+
## Response
16+
17+
This API is implemented as per the standard, you can find documentation on [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Response)
18+
19+
## Request
20+
21+
This API is implemented as per the standard, you can find documentation on [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Request)
22+
23+
## Header
24+
25+
This API is implemented as per the standard, you can find documentation on [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Headers)
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Class: WebSocket
2+
3+
> ⚠️ Warning: the WebSocket API is experimental and has known bugs.
4+
5+
Extends: [`EventTarget`](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget)
6+
7+
The WebSocket object provides a way to manage a WebSocket connection to a server, allowing bidirectional communication. The API follows the [WebSocket spec](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket).
8+
9+
## `new WebSocket(url[, protocol])`
10+
11+
Arguments:
12+
13+
* **url** `URL | string` - The url's protocol *must* be `ws` or `wss`.
14+
* **protocol** `string | string[]` (optional) - Subprotocol(s) to request the server use.
15+
16+
## Read More
17+
18+
- [MDN - WebSocket](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket)
19+
- [The WebSocket Specification](https://www.rfc-editor.org/rfc/rfc6455)
20+
- [The WHATWG WebSocket Specification](https://websockets.spec.whatwg.org/)

deps/undici/src/index.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,13 @@ import mockErrors from'./types/mock-errors'
1616
import ProxyAgent from'./types/proxy-agent'
1717
import { request, pipeline, stream, connect, upgrade } from './types/api'
1818

19+
export * from './types/cookies'
1920
export * from './types/fetch'
2021
export * from './types/file'
2122
export * from './types/filereader'
2223
export * from './types/formdata'
2324
export * from './types/diagnostics-channel'
25+
export * from './types/websocket'
2426
export { Interceptable } from './types/mock-interceptor'
2527

2628
export { Dispatcher, BalancedPool, Pool, Client, buildConnector, errors, Agent, request, stream, pipeline, connect, upgrade, setGlobalDispatcher, getGlobalDispatcher, setGlobalOrigin, getGlobalOrigin, MockClient, MockPool, MockAgent, mockErrors, ProxyAgent, RedirectHandler, DecoratorHandler }

deps/undici/src/index.js

Lines changed: 23 additions & 0 deletions

0 commit comments

Comments
 (0)