unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Nala Ginrut <nalaginrut@gmail.com>
To: Dave Thompson <davet@fsf.org>
Cc: guile-devel@gnu.org, David Thompson <davet@gnu.org>
Subject: Re: Handling HTTP "Upgrade" requests
Date: Thu, 26 Feb 2015 15:51:40 +0800	[thread overview]
Message-ID: <1424937100.7013.37.camel@Renee-desktop.suse> (raw)
In-Reply-To: <8dvbiqufhr.fsf@freestation00.office.fsf.org>

On Wed, 2015-02-25 at 11:23 -0500, Dave Thompson wrote:
> IMO, an asynchronous/multi-threaded server is a separate issue. I was
> aiming for a solution that allowed a single websocket to be used on
> Guile's single-thread default web server.  Of course, the websocket
> implementation should be able to be applied to a more advanced server,
> should one be written.
> 

Ah I see.

> I think you're right that something in the default HTTP server must be
> changed, but I haven't grokked the implementation enough to figure it
> out.  AFAICT, the HTTP server socket needs to be handed over to a
> WebSocket server procedure, suspending additional HTTP request
> processing until the WebSocket is closed and the socket is handed back
> to the HTTP server.  Does that make some sense?  Things are too foggy
> for me to tell.

Personally, I don't think websocket part should be based on inner HTTP
server. Or there'd be some changes of the architecture.

But if you really want to use inner server, I think there're some points
to be noticed:
1. check if it's websocket frame, then call the registered handler and
skip read-request to avoid the problem you've pasted;

2. the current inner server detects keep-alive based on HTTP header, so
you have to modify something to support comet connection for websocket
ports.

3. I have to mention that the current inner server is not non-block and
weak for slow-header-DDOS. So if you handle one request in a long time,
others' requests will be blocked in a long time. One of the easy
solution is to take advantage of Nginx reverse-proxy. But it doesn't
solve all the issues. ;-P


PS: To those who care, unfortunately, Guile has no epoll/kqueue yet,
that's one of the reasons why I want to write new server core for
Artanis. ;-)

Happy hacking!





  reply	other threads:[~2015-02-26  7:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-21 23:00 Handling HTTP "Upgrade" requests David Thompson
2015-02-25  5:05 ` Nala Ginrut
2015-02-25 16:23   ` Dave Thompson
2015-02-26  7:51     ` Nala Ginrut [this message]
2015-03-10 20:59       ` Andy Wingo
2015-03-11  3:55         ` Nala Ginrut
2015-03-04 10:51 ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1424937100.7013.37.camel@Renee-desktop.suse \
    --to=nalaginrut@gmail.com \
    --cc=davet@fsf.org \
    --cc=davet@gnu.org \
    --cc=guile-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).