From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Thompson Newsgroups: gmane.lisp.guile.devel Subject: Handling HTTP "Upgrade" requests Date: Sat, 21 Feb 2015 18:00:03 -0500 Message-ID: <87wq3aan0s.fsf@fsf.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1424559623 6441 80.91.229.3 (21 Feb 2015 23:00:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 21 Feb 2015 23:00:23 +0000 (UTC) To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sun Feb 22 00:00:10 2015 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YPJ1u-0006LH-B5 for guile-devel@m.gmane.org; Sun, 22 Feb 2015 00:00:10 +0100 Original-Received: from localhost ([::1]:37768 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YPJ1t-0004H2-BS for guile-devel@m.gmane.org; Sat, 21 Feb 2015 18:00:09 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35201) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YPJ1q-0004F6-6F for guile-devel@gnu.org; Sat, 21 Feb 2015 18:00:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YPJ1p-0006Ps-7j for guile-devel@gnu.org; Sat, 21 Feb 2015 18:00:06 -0500 Original-Received: from mail.fsf.org ([208.118.235.13]:60982) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YPJ1p-0006PD-5K for guile-devel@gnu.org; Sat, 21 Feb 2015 18:00:05 -0500 Original-Received: from 209-6-40-86.c3-0.smr-ubr1.sbo-smr.ma.cable.rcn.com ([209.6.40.86]:59856 helo=izanagi) by mail.fsf.org with esmtpsa (TLS-1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.69) (envelope-from ) id 1YPJ1o-0003Qa-O0 for guile-devel@gnu.org; Sat, 21 Feb 2015 18:00:04 -0500 User-Agent: Notmuch/0.18.2 (http://notmuchmail.org) Emacs/24.4.1 (x86_64-pc-linux-gnu) X-detected-operating-system: by mail.fsf.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 208.118.235.13 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:17671 Archived-At: I've been tinkering with adding WebSockets[0] support to Guile's HTTP arsenal. The first blocking issue I've come across is that an HTTP server must be able to detect the "Upgrade" header[1] and change protocols. In my case, once a client thread accepts a WebSocket connection, it should speak the WebSocket protocol, not HTTP. Here's an example of a backtrace that you'd see after a successful WebSocket handshake, when the client tries to actually make use of the socket: In ice-9/boot-9.scm: 171:12 3 (with-throw-handler #t # #) In web/server/http.scm: 126:17 2 (#) In web/request.scm: 204:31 1 (read-request # ()) In ice-9/boot-9.scm: 106:20 0 (# ...) ERROR: Bad request: Bad Request-Line: "\x81\x86B\x93=EF=BF=BDQ" Does anyone have an idea about how to approach this problem? Thanks in advance! [0] http://www.websocket.org/ [1] http://en.wikipedia.org/wiki/HTTP/1.1_Upgrade_header --=20 David Thompson Web Developer - Free Software Foundation - http://fsf.org GPG Key: 0FF1D807 Support the FSF: https://fsf.org/donate