{"id":18077600,"url":"https://github.com/fukamachi/websocket-driver","last_synced_at":"2026-01-28T04:47:52.631Z","repository":{"id":20993475,"uuid":"24283030","full_name":"fukamachi/websocket-driver","owner":"fukamachi","description":"WebSocket server/client implementation for Common Lisp","archived":false,"fork":false,"pushed_at":"2025-11-16T09:01:54.000Z","size":123,"stargazers_count":109,"open_issues_count":19,"forks_count":28,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-11-16T11:13:25.423Z","etag":null,"topics":["common-lisp","websocket"],"latest_commit_sha":null,"homepage":"","language":"Common Lisp","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fukamachi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2014-09-21T05:27:58.000Z","updated_at":"2025-11-16T09:01:58.000Z","dependencies_parsed_at":"2025-03-12T03:25:08.261Z","dependency_job_id":"a7491f80-84a7-4cac-bb63-bcf6683b300e","html_url":"https://github.com/fukamachi/websocket-driver","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/fukamachi/websocket-driver","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fukamachi%2Fwebsocket-driver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fukamachi%2Fwebsocket-driver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fukamachi%2Fwebsocket-driver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fukamachi%2Fwebsocket-driver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fukamachi","download_url":"https://codeload.github.com/fukamachi/websocket-driver/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fukamachi%2Fwebsocket-driver/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28838777,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-28T02:10:51.810Z","status":"ssl_error","status_checked_at":"2026-01-28T02:10:50.806Z","response_time":57,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["common-lisp","websocket"],"created_at":"2024-10-31T11:46:10.950Z","updated_at":"2026-01-28T04:47:52.613Z","avatar_url":"https://github.com/fukamachi.png","language":"Common Lisp","funding_links":[],"categories":["Interfaces to other package managers"],"sub_categories":["Hosting platforms"],"readme":"# Websocket Driver\n\n[![Build Status](https://travis-ci.org/fukamachi/websocket-driver.svg?branch=master)](https://travis-ci.org/fukamachi/websocket-driver)\n[![Quicklisp dist](http://quickdocs.org/badge/websocket-driver.svg)](http://quickdocs.org/websocket-driver/)\n\nThis library provides WebSocket server \u0026 client implementation for Common Lisp.\n\n## Supported Servers\n\n* [Hunchentoot](http://weitz.de/hunchentoot/)\n* [Wookie](http://wookie.lyonbros.com)\n* [Woo](https://github.com/fukamachi/woo)\n\n## Usage\n\n### Server-side with Clack\n\nWebSocket server implementation is designed to work with [Clack](https://github.com/fukamachi/clack), which is a abstraction layer for web servers.\n\n```common-lisp\n(ql:quickload '(:websocket-driver-server :clack))\n\n(use-package :websocket-driver)\n\n(defvar *echo-server*\n  (lambda (env)\n    (let ((ws (make-server env)))\n      (on :message ws\n          (lambda (message)\n            (send ws message)))\n      (lambda (responder)\n        (declare (ignore responder))\n        (start-connection ws)))))\n\n;; Start Wookie server\n(clack:clackup *echo-server* :server :wookie :port 5000)\n```\n\nThe backend server can be changed by replacing `:wookie` by other servers.\n\n### Client-side\n\n```common-lisp\n(ql:quickload :websocket-driver-client)\n\n(defvar *client* (wsd:make-client \"ws://localhost:5000/echo\"))\n\n(wsd:start-connection *client*)\n(wsd:on :message *client*\n        (lambda (message)\n          (format t \"~\u0026Got: ~A~%\" message)))\n(wsd:send *client* \"Hi\")\n(wsd:close-connection *client*)\n```\n\n## APIs\n\n### \\[Function] make-server (env \u0026key max-length accept-protocols additional-headers)\n\nReturns a new `SERVER` object. The `ENV` is a property list represents server information, which [Clack](http://clacklisp.org) provides.\n\nThe `max-length` is the maximum message size allowed. The default is `#x3ffffff`. If at any time it stays bigger than this, the connection will be closed with code 1009 (too-large).\n\nThe `accept-protocols` is a list of custom protocol names as strings. This will be used for checking `Sec-WebSocket-Protocol` header client sent. The default is an empty list.\n\nThe `additional-headers` is an association list which represents HTTP headers to use in WebSocket handshake response. The default is an empty list.\n\n### \\[Function] make-client (url \u0026key max-length accept-protocols additional-headers)\n\nReturns a new `CLIENT` object. The `URL` is a string to connect.\n\nAdditional keyword arguments `max-length`, `accept-protocols` and `additional-headers` are shared with `make-server`.\n\n### \\[Class] ws\n\nThe base class for `server` and `client`.\n\nAs this inherits `event-emitter`, its object can be attached event listerners by `on`.\n\n#### \\[Event] :open\n\nCalled when the socket becomes open.\n\n```common-lisp\n(on :open ws\n    (lambda ()\n      (format t \"Connected.~%\")))\n```\n\n#### \\[Event] :message\n\nCalled when a message is received. The callback function takes a `MESSAGE` as an argument which is either a string in the case of a text message or an `(UNSIGNED-BYTE 8)` vector in the case of a binary message.\n\n```common-lisp\n(on :message ws\n    (lambda (message)\n      (format t \"Received: ~S~%\" message)))\n```\n\n#### \\[Event] :error\n\nCalled when a protocol error occurs due to the other peer sending an invalid byte sequence. The callback function takes a `PROTOCOL-ERROR` as an argument.\n\n```common-lisp\n(on :error ws\n    (lambda (error)\n      (format t \"Got an error: ~S~%\" error)))\n```\n\n#### \\[Event] :close\n\nCalled when the socket becomes closed. The `CALLBACK` function takes `CODE` and `REASON` as arguments.\n\n```common-lisp\n(on :close ws\n    (lambda (\u0026key code reason)\n      (format t \"Closed because '~A' (Code=~A)~%\" reason code)))\n```\n\n### \\[Class] server\n\nThe class for WebSocket (version 13) server implementation.\n\n### \\[Class] client\n\nThe class for WebSocket client implementation.\n\n### \\[Method] `(start-connection ws)`\n\nInitiates the protocol by sending the handshake - either the response for a server-side driver or the request for a client-side one. This should be the first method you invoke. Returns `T` if a handshake was sent.\n\n### \\[Method] `(send ws data \u0026key start end type code callback)`\n\nSends `DATA` over the socket.\n\n### \\[Function] `(send-text ws message \u0026key start end callback)`\n\nSends a text message over the socket.\n\n### \\[Function] `(send-binary ws usb8-vector \u0026key start end callback)`\n\nTakes an `(UNSIGNED-BYTE 8)` vector and sends them as a binary message.\n\n### \\[Method] `(send-ping ws \u0026optional message callback)`\n\nSends a ping frame over the socket, queueing it if necessary.\n\n### \\[Method] `(close-connection ws)`\n\nInitiates the closing handshake if the socket is still open.\n\n### \\[Method] `(version driver)`\n\nReturns the WebSocket version in use as a string (ex. \"hybi-13\").\n\n### \\[Method] `(protocol driver)`\n\nReturns a string containing the selected subprotocol, if any was agreed upon using the `Sec-WebSocket-Protocol` mechanism.\n\n### \\[Method] `(ready-state ws)`\n\nReturns the connection state as a keyword, which is one of `:connecting`, `:open`, `:closing` and `:closed`.\n\n## Author\n\n* Eitaro Fukamachi (e.arrows@gmail.com)\n\n## Copyright\n\nCopyright (c) 2014 Eitaro Fukamachi (e.arrows@gmail.com)\n\n## License\n\nLicensed under the BSD 2-Clause License.\n\n## See Also\n\n* [Clack](http://clacklisp.org)\n* [Event Emitter](https://github.com/fukamachi/event-emitter)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffukamachi%2Fwebsocket-driver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffukamachi%2Fwebsocket-driver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffukamachi%2Fwebsocket-driver/lists"}