Skip to content

Commit b24d8f5

Browse files
committed
update article.md -- websocket
1 parent 0ccebb0 commit b24d8f5

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

5-network/11-websocket/article.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -370,20 +370,20 @@ function onSocketConnect(ws) {
370370

371371
که API ساده ای است
372372

373-
The API is simple.
373+
روش‌ها:
374374

375-
Methods:
376375
- `socket.send(data)`,
377376
- `socket.close([code], [reason])`.
378377

379-
Events:
378+
رویدادها:
379+
380380
- `open`,
381381
- `message`,
382382
- `error`,
383383
- `close`.
384384

385-
WebSocket by itself does not include reconnection, authentication and many other high-level mechanisms. So there are client/server libraries for that, and it's also possible to implement these capabilities manually.
385+
وب سوکت به تنهایی شامل امکاناتی همچون اتصال دوباره, احراز هویت و دیگر مکانیزم‌های سطح بالا نمیباشد. بنابراین کتابخانه هایی هم در کلاینت و هم در سرور برای اینکار وجود دارند، همچنین پیاده‌سازی دستی این موارد امکان پذیر میباشد.
386386

387-
Sometimes, to integrate WebSocket into existing projects, people run a WebSocket server in parallel with the main HTTP-server, and they share a single database. Requests to WebSocket use `wss://ws.site.com`, a subdomain that leads to the WebSocket server, while `https://site.com` goes to the main HTTP-server.
387+
گاهی اوقات، برای افزودن وب سوکت به یک پروژه‌، افراد یک سرور وب سوکت به موازات سرور http را با یک دیتابیس مشترک راه اندازی میکنند. درخواست های وب سوکت از آدرس `wss://ws.site.com` که یک ساب دامین بوده و به سرور وب سوکت میرسد استفاده میکنند درحالی که درخواست های آدرس `https://site.com` به سرور http اصلی میروند.
388388

389-
Surely, other ways of integration are also possible.
389+
مطمئنا راههای دیگری برای ادغام وجود دارد.

0 commit comments

Comments
 (0)