File tree 2 files changed +45
-3
lines changed 2 files changed +45
-3
lines changed Original file line number Diff line number Diff line change @@ -340,15 +340,48 @@ Default value: `true`
340
340
341
341
Whether to add the timestamp query param to each request (for cache busting).
342
342
343
+ ### ` transportOptions `
344
+
345
+ * Added in v2.0.0*
346
+
347
+ Default value: ` {} `
348
+
349
+ Transport-specific options.
350
+
351
+ Example:
352
+
353
+ ``` js
354
+ import { io } from " socket.io-client" ;
355
+
356
+ const socket = io ({
357
+ path: " /path-for-http-long-polling/" ,
358
+ transportOptions: {
359
+ websocket: {
360
+ path: " /path-for-websocket/"
361
+ }
362
+ }
363
+ });
364
+ ```
343
365
344
366
### ` transports `
345
367
346
- Default value: ` ["polling", "websocket"] `
368
+ <details className =" changelog " >
369
+ <summary>History</summary>
370
+
371
+ | Version | Changes |
372
+ | ---------| --------------------------|
373
+ | v4.7.0 | ` webtransport ` is added. |
374
+ | v1.0.0 | First implementation. |
375
+
376
+ </details >
377
+
378
+ Default value: ` ["polling", "websocket", "webtransport"] `
347
379
348
380
The low-level connection to the Socket.IO server can either be established with:
349
381
350
382
- HTTP long-polling: successive HTTP requests (` POST ` for writing, ` GET ` for reading)
351
- - [ WebSocket] ( https://en.wikipedia.org/wiki/WebSocket )
383
+ - [ WebSocket] ( https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API )
384
+ - [ WebTransport] ( https://developer.mozilla.org/en-US/docs/Web/API/WebTransport_API )
352
385
353
386
The following example disables the HTTP long-polling transport:
354
387
Original file line number Diff line number Diff line change @@ -565,8 +565,17 @@ Default value: `["polling", "websocket"]`
565
565
566
566
The low-level transports that are allowed on the server-side.
567
567
568
- See also: client-side [ ` transports ` ] ( client-options.md#transports )
568
+ Example with WebTransport enabled:
569
+
570
+ ``` js
571
+ const io = new Server ({
572
+ transports: [" polling" , " websocket" , " webtransport" ]
573
+ });
574
+ ```
569
575
576
+ Please check the WebTransport example [ here] ( /get-started/webtransport ) .
577
+
578
+ See also: client-side [ ` transports ` ] ( client-options.md#transports )
570
579
571
580
### ` upgradeTimeout `
572
581
You can’t perform that action at this time.
0 commit comments