diff options
| author | 2024-11-05 13:36:43 +0000 | |
|---|---|---|
| committer | 2024-11-05 14:36:43 +0100 | |
| commit | 38a08cd25aa89f55e2ae6d5e5a4160fada111680 (patch) | |
| tree | cde4135a5e4c0faddb7ab1fa9a11ccd899db91f1 /docs/locales/zh/getting_started/reverse_proxy/websocket.md | |
| parent | [bugfix] Fix setting immediate `expires_at` value on filter endpoints (#3513) (diff) | |
| download | gotosocial-38a08cd25aa89f55e2ae6d5e5a4160fada111680.tar.xz | |
[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
Diffstat (limited to 'docs/locales/zh/getting_started/reverse_proxy/websocket.md')
| -rw-r--r-- | docs/locales/zh/getting_started/reverse_proxy/websocket.md | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/docs/locales/zh/getting_started/reverse_proxy/websocket.md b/docs/locales/zh/getting_started/reverse_proxy/websocket.md new file mode 100644 index 000000000..e1391ec45 --- /dev/null +++ b/docs/locales/zh/getting_started/reverse_proxy/websocket.md @@ -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 +``` + +无论你的设置如何,你都需要确保这些头在你的反向代理中被允许,这可能需要根据所使用的具体反向代理进行额外配置。 |
