Skip to content

Commit eb7e281

Browse files
authored
Merge pull request #1026 from tonchique/patch-3
Update article.md
2 parents 49476f4 + 77ad4eb commit eb7e281

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

5-network/08-websocket/article.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ For instance:
124124

125125
`Sec-WebSocket-Extensions` is sent by the browser automatically, with a list of possible extensions it supports.
126126

127-
`Sec-WebSocket-Protocol` is depends on us: we decide what kind of data we send. The second optional parameter of `new WebSocket` lists subprotocols:
127+
`Sec-WebSocket-Protocol` depends on us: we decide what kind of data we send. The second optional parameter of `new WebSocket` lists subprotocols:
128128

129129
```js
130130
let socket = new WebSocket("wss://javascript.info/chat", ["soap", "wamp"]);
@@ -250,7 +250,7 @@ There are other codes like:
250250

251251
Please refer to the [RFC6455, §7.4.1](https://tools.ietf.org/html/rfc6455#section-7.4.1) for the full list.
252252

253-
WebSocket codes are somewhat like HTTP codes, but different. In particular, an codes less than `1000` are reserved, there'll be an error if we try to set such a code.
253+
WebSocket codes are somewhat like HTTP codes, but different. In particular, any codes less than `1000` are reserved, there'll be an error if we try to set such a code.
254254

255255
```js
256256
// in case connection is broken
@@ -360,7 +360,7 @@ You can also download it (upper-right button in the iframe) and run locally. Jus
360360

361361
## Summary
362362

363-
WebSocket is a modern way to have persisten browser-server connections.
363+
WebSocket is a modern way to have persistent browser-server connections.
364364

365365
- WebSockets don't have cross-origin limitations.
366366
- They are well-supported in browsers.
@@ -378,7 +378,7 @@ Events:
378378
- `error`,
379379
- `close`.
380380

381-
WebSocket by itself does not include reconnection, authentication and many other high-level mechanisms. So there are client/server libraries add them. But it's also possible to implement these manually and integrate WebSockets with an existing site.
381+
WebSocket by itself does not include reconnection, authentication and many other high-level mechanisms. So there are client/server libraries that add them. But it's also possible to implement these manually and integrate WebSockets with an existing site.
382382

383383
For integration purposes, a WebSocket server is usually running in parallel with the main server, and they share a single database. Requests to WebSocket use `wss://ws.site.com`, a subdomain that leads to WebSocket server, while `https://site.com` goes to the main HTTP-server.
384384

0 commit comments

Comments
 (0)