fast-websocket

2024年10月12日

Optimized WebSocket protocol parser

Author

Eitaro Fukamachi

License

BSD 2-Clause

fast-websocket

Build Status Coverage Status Quicklisp dist

Optimized low-level WebSocket protocol parser/composer.

Warning

This software is still BETA quality. The APIs will be likely to change.

Usage

(use-package:fast-websocket)
(let*((ws(make-ws))(body(make-string-output-stream))(parser(make-parser ws
:require-maskingt:message-callback(lambda(message)(princ message body)):close-callback(lambda(payload&keycode)(formatt"Client closed a connection: ~A (Code: ~D)~%" payload code)))))(funcall parser (make-array11:element-type'(unsigned-byte8):initial-contents(list129133225106102916915102113142)))
(princ(opcode-name(ws-opcode ws)));-> :TEXT
(princ(get-output-stream-string body));-> Hello
t)
(compose-frame"bye":type:close:code(error-code:protocol-error));=> #(136 5 3 234 98 121 101)

Installation

cd ~/common-lisp
git clone https://github.com/fukamachi/fast-websocket
(ql:quickload :fast-websocket)

See Also

Author

Copyright

Copyright (c) 2015 Eitaro Fukamachi (e.arrows@gmail.com)

License

Licensed under the BSD 2-Clause License.

AltStyle によって変換されたページ (->オリジナル) /