1 ;;; guile-websocket --- WebSocket client/server
2 ;;; Copyright © 2016 David Thompson <davet@gnu.org>
4 ;;; This file is part of guile-websocket.
6 ;;; Guile-websocket is free software; you can redistribute it and/or modify
7 ;;; it under the terms of the GNU Lesser General Public License as
8 ;;; published by the Free Software Foundation; either version 3 of the
9 ;;; License, or (at your option) any later version.
11 ;;; Guile-websocket is distributed in the hope that it will be useful,
12 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
13 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 ;;; Lesser General Public License for more details.
16 ;;; You should have received a copy of the GNU Lesser General Public
17 ;;; License along with guile-websocket. If not, see
18 ;;; <http://www.gnu.org/licenses/>.
22 ;; WebSocket utilities.
26 (define-module (8sync systems websocket utils)
27 #:use-module (rnrs bytevectors)
28 #:use-module (8sync contrib base64)
29 #:use-module (8sync contrib sha-1)
30 #:export (%handshake-guid
33 ;; See section 1.3 - Opening Handshake
34 (define %handshake-guid "258EAFA5-E914-47DA-95CA-C5AB0DC85B11")
36 (define (make-accept-key client-key)
37 "Return a WebSocket accept key based on CLIENT-KEY, a base64 encoded
43 (string-append client-key %handshake-guid))))))