[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Handling HTTP "Upgrade" requests
From: |
David Thompson |
Subject: |
Handling HTTP "Upgrade" requests |
Date: |
Sat, 21 Feb 2015 18:00:03 -0500 |
User-agent: |
Notmuch/0.18.2 (http://notmuchmail.org) Emacs/24.4.1 (x86_64-pc-linux-gnu) |
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 #<procedure 1720560 at web/...> #)
In web/server/http.scm:
126:17 2 (#<procedure 1720560 at web/server/http.scm:125:15 ()>)
In web/request.scm:
204:31 1 (read-request #<closed: file 0> ())
In ice-9/boot-9.scm:
106:20 0 (#<procedure 10ce380 at ice-9/boot-9.scm:97:6 (thr...> ...)
ERROR: Bad request: Bad Request-Line: "\x81\x86B\x93�Q"
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
--
David Thompson
Web Developer - Free Software Foundation - http://fsf.org
GPG Key: 0FF1D807
Support the FSF: https://fsf.org/donate
- Handling HTTP "Upgrade" requests,
David Thompson <=