尚未偵測到更新。GitHub 發布版本後會顯示在這裡。
個人 GitHub 帳號下公開儲存庫的擁有者可以登入並驗證所有權,自行管理介紹,無需管理員核准。
登入並產生驗證檔案,在 30 分鐘內將其提交至此儲存庫的預設分支。其他分支或分叉儲存庫中的檔案無效。然後在下方檢查檔案,即可無需管理員核准直接管理專案。請保留檔案以維持管理權限。
如需登入,將前往登入頁面。登入後請回到此處,再次點擊所選的驗證按鈕。
在專案資料夾中執行 /nomorevibe verify,即可驗證所有權並自行管理介紹。
一分鐘完成驗證製作者的介紹僅有上面的一句話。 更多詳情請閱讀儲存庫 README。 儲存庫 README ↗
正在載入完整 README。
檢視完整 README ↗WebSocket (RFC 6455) for [[https://github.com/Kiyomi-Computation-Systems/chez-http-server][chez-http-server]], the HTTP/1.1 server for Chez Scheme.
#+begin_quote ✨ AI Disclosure: LLMs are used extensively in the planning and development of this project. #+end_quote
** Features
No compression and no client: this library is for servers. The API may change in any release before 1.0. [[file:CHANGELOG.md][CHANGELOG.md]] lists what each release changes.
** Quick start
#+begin_src scheme (import (rnrs) (http-server) (websocket))
(serve (lambda (request) (if (string=? (request-path request) "/echo") (websocket-accept request (lambda (ws) (let loop () (websocket-send! ws (websocket-receive ws)) (loop)))) (make-response 404 #f '() (string->utf8 "not found\n"))))) #+end_src
Save it as echo.sps, start it with make run PROGRAM=echo.sps, and connect
a client such as websocat ws://127.0.0.1:8080/echo: each line you send comes
back. How a handler reads, writes and closes is in [[file:docs/handlers.md][docs/handlers.md]], and
the rest of the documentation starts at [[file:docs/README.md][docs/README.md]], also published at
[[https://kiyomi-computation-systems.github.io/chez-websocket/][kiyomi-computation-systems.github.io/chez-websocket]].
** Build and test
Prerequisites:
The one dependency, chez-http-server, is a git submodule under vendor/,
pinned at a release tag. It carries its own pins: chez-libuv, chez-httparse
(with byte-machine), uriparse, and chez-srfi for the tests.
#+begin_src sh git clone https://github.com/Kiyomi-Computation-Systems/chez-websocket.git cd chez-websocket make build # clones the pins, builds the chez-libuv shim, assembles the library path make test # runs every tests/test-*.sps #+end_src
Clone without --recursive: make submodules, which make build runs, clones
what the build needs and not the server's own test clients. make help lists
every target; make check-pins verifies the server sits at its pin, and each
pin it carries where the server records it.
make site renders docs/ into build/site/, the pages GitHub Pages
publishes for each release. It needs the system cmark-gfm library (brew
install cmark-gfm or apt install cmark-gfm); make check-site fails on a
broken link or anchor.
** Autobahn
make autobahn runs Autobahn|Testsuite's fuzzing client in Docker against
[[file:tests/autobahn/echo.sps][tests/autobahn/echo.sps]], and fails if any case's verdict differs from
[[file:tests/autobahn/verdicts.txt][tests/autobahn/verdicts.txt]], better or worse. Autobahn's image is built for
amd64, so Docker emulates it on other machines. On Linux the echo server runs
on your machine. On macOS and Windows, whose Docker Desktop has no host
network, it runs in a Linux container beside Autobahn: make echo-image builds
it, the first time in about four minutes, and make docker-smoke checks it
starts and stops.
** Configuration
Every limit has a default and a CHEZ_WS_ environment override, read once as
your program starts — see [[file:docs/configuration.md][docs/configuration.md]]. The server's own CHEZ_HTTP_
variables still apply.
** Handlers
How a handler takes a WebSocket, what the handshake refuses, how to read, write and close, what each close means, and how to choose subprotocols, origins and limits of its own — see [[file:docs/handlers.md][docs/handlers.md]].
** Examples
[[file:examples/README.org][examples/]] holds small servers to run and talk to from your browser: an
echo, a chat room, and a clock that sends a tick each second. Start one with
make run PROGRAM=examples/echo.sps and open http://127.0.0.1:8080/.
** Contributing
[[file:CONTRIBUTING.md][CONTRIBUTING.md]] says how to set up, which checks a pull request must pass, and the house rules.
** Security
Report a vulnerability privately; [[file:SECURITY.md][SECURITY.md]] says how.
** License
© [[https://kiyomicomputation.systems/][Kiyomi Computation Systems LLC]]. Licensed under BSD 3-Clause — see [[file:LICENSE][LICENSE]].