mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-12-29 17:46:15 -06:00
[docs] add zh docs (#3507)
* [docs] add zh docs * [docs] add lang dropdown * [docs] update mkdocs zh config * [docs] migrate assets * [docs] update overrides dir in mkdocs zh config * [docs] exclude locales director in main mkdocs config * [docs] rename assets to public to avoid conflicting with template * [docs] extra_css change followup * [docs] add theme.palette.toggle.icon back into mkdocs zh config * [docs] fix zh readme reference + migrate language-specific repo markdown to docs * [docs] translate remaining repo docs + update reference * [docs] update zh index.md reference * [docs/zh] wording alignment
This commit is contained in:
parent
e953d80dff
commit
38a08cd25a
139 changed files with 20407 additions and 24 deletions
43
docs/locales/zh/getting_started/reverse_proxy/websocket.md
Normal file
43
docs/locales/zh/getting_started/reverse_proxy/websocket.md
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
# WebSocket
|
||||
|
||||
GoToSocial 使用安全的 [WebSocket 协议](https://en.wikipedia.org/wiki/WebSocket)(即 `wss`)来通过客户端应用程序(如 Semaphore)实现贴文和通知的实时更新。
|
||||
|
||||
为了使用此功能,你需要确保配置 GoToSocial 所在的代理允许 WebSocket 连接通过。
|
||||
|
||||
WebSocket 端点位于 `wss://example.org/api/v1/streaming`,其中 `example.org` 是你的 GoToSocial 实例的域名。
|
||||
|
||||
WebSocket 端点使用在[通用配置](../../configuration/general.md)的 `port` 部分中配置的相同端口。
|
||||
|
||||
典型的 WebSocket **请求**头,如 Pinafore 所发送的如下所示:
|
||||
|
||||
```text
|
||||
Host: example.org
|
||||
User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:99.0) Gecko/20100101 Firefox/99.0
|
||||
Accept: */*
|
||||
Accept-Language: en-US,en;q=0.5
|
||||
Accept-Encoding: gzip, deflate, br
|
||||
Sec-WebSocket-Version: 13
|
||||
Origin: https://pinafore.social
|
||||
Sec-WebSocket-Protocol: null
|
||||
Sec-WebSocket-Extensions: permessage-deflate
|
||||
Sec-WebSocket-Key: YWFhYWFhYm9vYmllcwo=
|
||||
DNT: 1
|
||||
Connection: keep-alive, Upgrade
|
||||
Sec-Fetch-Dest: websocket
|
||||
Sec-Fetch-Mode: websocket
|
||||
Sec-Fetch-Site: cross-site
|
||||
Pragma: no-cache
|
||||
Cache-Control: no-cache
|
||||
Upgrade: websocket
|
||||
```
|
||||
|
||||
典型的 WebSocket **响应**头,如 GoToSocial 返回的如下所示:
|
||||
|
||||
```text
|
||||
HTTP/1.1 101 Switching Protocols
|
||||
Upgrade: websocket
|
||||
Connection: Upgrade
|
||||
Sec-WebSocket-Accept: WVdGaFlXRmhZbTl2WW1sbGN3bz0K
|
||||
```
|
||||
|
||||
无论你的设置如何,你都需要确保这些头在你的反向代理中被允许,这可能需要根据所使用的具体反向代理进行额外配置。
|
||||
Loading…
Add table
Add a link
Reference in a new issue