@@ -251,19 +251,19 @@ added: v0.11.4
|
251 | 251 | |
252 | 252 | Produces a socket/stream to be used for HTTP requests. |
253 | 253 | |
254 | | -By default, this function behaves identically to [`net.createConnection(options)`][], |
| 254 | +By default, this function behaves identically to [`net.createConnection()`][], |
255 | 255 | synchronously returning the created socket. The optional `callback` parameter in the |
256 | 256 | signature is **not** used by this default implementation. |
257 | 257 | |
258 | 258 | However, custom agents may override this method to provide greater flexibility, |
259 | 259 | for example, to create sockets asynchronously. When overriding `createConnection`: |
260 | 260 | |
261 | | -1. **Synchronous socket creation**: The overriding method can return the |
262 | | - socket/stream directly. |
263 | | -2. **Asynchronous socket creation**: The overriding method can accept the `callback` |
264 | | - and pass the created socket/stream to it (e.g., `callback(null, newSocket)`). |
265 | | - If an error occurs during socket creation, it should be passed as the first |
266 | | - argument to the `callback` (e.g., `callback(err)`). |
| 261 | +1. **Synchronous socket creation**: The overriding method can return the |
| 262 | + socket/stream directly. |
| 263 | +2. **Asynchronous socket creation**: The overriding method can accept the `callback` |
| 264 | + and pass the created socket/stream to it (e.g., `callback(null, newSocket)`). |
| 265 | + If an error occurs during socket creation, it should be passed as the first |
| 266 | + argument to the `callback` (e.g., `callback(err)`). |
267 | 267 | |
268 | 268 | The agent will call the provided `createConnection` function with `options` and |
269 | 269 | this internal `callback`. The `callback` provided by the agent has a signature |
|