You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,13 +7,13 @@
7
7
8
8
<!-- [![Codecov][codecov-src]][codecov-href] -->
9
9
10
-
> [!WIP]
11
-
> This project and API is under heavy development and opened to test integrations. Don't rely on it for production yet. Feedbacks welcome about API design!
10
+
> [!WARNING]
11
+
> This project and API are under heavy development and trial. Please don't rely on it for production yet. Feedback is more than welcome!
12
12
13
-
Cross-platform WebSocket server adapters:
13
+
Cross-platform WebSocket Servers:
14
14
15
-
- Elegant, typed and simple interface to define WebSocket handlers
16
-
- Performant per-server handlers instead of per-connection events api ([why](https://bun.sh/docs/api/websockets#lcYFjkFYJC-summary))
15
+
- Elegant, typed, and simple interface to define your WebSocket server handlers
16
+
- Performant per-server handlers instead of per-connection events API ([why](https://bun.sh/docs/api/websockets#lcYFjkFYJC-summary))
17
17
- Zero dependencies with bundled [ws](https://github.com/websockets/ws) types and runtime for [Node.js](https://nodejs.org/) support
18
18
- Native integration with [Bun](https://bun.sh/) and [Deno](https://deno.com/) WebSocket API
19
19
- Super lightweight tree-shakable packaging
@@ -37,11 +37,11 @@ bun install crossws
37
37
38
38
## Integration
39
39
40
-
CrossWS allows integrating your WebSocket handlers with different runtimes and platforms using built-in adapters. Each runtime has specific method of integrating WebSocket. Once integrated, your custom handlers (such as `onMessage`) will work consitent even if you change the runtime!
40
+
CrossWS allows integrating your WebSocket handlers with different runtimes and platforms using built-in adapters. Each runtime has a specific method of integrating WebSocket. Once integrated, your custom handlers (such as `onMessage`) will work consistently even if you change the runtime!
41
41
42
42
### Integration with **Node.js**
43
43
44
-
In order to integrate crosws with your Node.js HTTP server, you need to connect `upgrade` event to `handleUpgrade` method returned from adapter. Behind the scenes CrossWS uses an embdeded version of [ws](https://github.com/websockets/ws).
44
+
To integrate CrossWS with your Node.js HTTP server, you need to connect the `upgrade` event to the `handleUpgrade` method returned from the adapter. Behind the scenes, CrossWS uses an embedded version of [ws](https://github.com/websockets/ws).
45
45
46
46
```ts
47
47
// Initialize Server
@@ -64,7 +64,7 @@ See [playground/node.ts](./playground/node.ts) for demo and [src/adapters/node.t
64
64
65
65
## Integration with **Bun**
66
66
67
-
In order to integrate crosws with your Bun server, you need to check for `server.upgrade` and also pass `websocket` object returned from adapter to server options. CrossWS leverages native Bun WebSocket API.
67
+
To integrate crosws with your Bun server, you need to check for `server.upgrade` and also pass the `websocket` object returned from the adapter to server options. CrossWS leverages native Bun WebSocket API.
68
68
69
69
```ts
70
70
importbunAdapterfrom"./dist/adapters/bun";
@@ -90,7 +90,7 @@ See [playground/bun.ts](./playground/bun.ts) for demo and [src/adapters/bun.ts](
90
90
91
91
## Integration with **Deno**
92
92
93
-
In order to integrate crosws with your Deno server, you need to check for `upgrade` header than then call `handleUpgrade` method from adapter passing the incoming request object. Returned value is server upgrade response.
93
+
To integrate CrossWS with your Deno server, you need to check for the `upgrade` header and then call `handleUpgrade` method from the adapter passing the incoming request object. The returned value is the server upgrade response.
0 commit comments