From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Status: No, score=-3.7 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from mail-qk0-f178.google.com (mail-qk0-f178.google.com [209.85.220.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id E3C9820193 for ; Fri, 5 Aug 2016 23:49:19 +0000 (UTC) Received: by mail-qk0-f178.google.com with SMTP id v123so144768482qkh.3 for ; Fri, 05 Aug 2016 16:49:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2be-co-il.20150623.gappssmtp.com; s=20150623; h=from:content-transfer-encoding:subject:message-id:date:to :mime-version; bh=wQ/k+uYQLdM0hrdYAyA/8Hogg4JLo1yRGVSKfMOn/vY=; b=Bg93nSaYRN8Zj2+FIe8kBqcsdVwbT35Ynr87HmUuVuTTiDcG96nXHJuWmvcsn3aeUc 17neS6QR7eQ5k6grmcO+CGkwYISnaLhblrY7Fcufl9qAAcDPgKM3CdXlXvIMgbiwbcRW Bsa47XjrFu2xqa5bboWT4YZlmwKo3ug12JnkXkf++TWgKkdlucH5mRfvbsB3ITzQ7Jk1 DAl2tQTmdbdsvICxPucLZpjMBiySu3dFTi54OeSPnp+Fs+k2VBGvb+Cx5yyTgynW6ct6 rearMUDbfQz2cj4scTW4D3vcrVL/zkx8FRkkzvUmvwiy3aoXNV3LKWjiSuZgOP7fT+4T A9NA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:content-transfer-encoding:subject :message-id:date:to:mime-version; bh=wQ/k+uYQLdM0hrdYAyA/8Hogg4JLo1yRGVSKfMOn/vY=; b=CqMJpbgWk1esvX5jEmm4bz2g8QWsYZmf7KRFR60bpE0D7m2gqLPDXRR0qvANUmVz1J qRr+un9IOvF7DsIbEqcHinKAYRE78IhumPVzNuMD8oy3MqZRTSGSO7A+t51feMnAk5Vp ftq/qHAflXTPAJ9E7wxq1szs73I79n7RvFJ1RK1CebT1wgv6SeoF2JaR5m3Nd5+ihfko vVmjrJKAYd2CiqphZr82Pp5MnNnRXUi5YhwwpKvbdpC0cR9fseCbMcQYo6v6BNIGi0hN QV0H056qsjBJXDCOmVtO0WiJ0WZW9sWE+oDBp8r5nACwZA3sDcR6fvZ1YMuKLnCcxvUQ Cn3w== X-Gm-Message-State: AEkooutp5KEQc7W3Q0Xf0x8+tk5EIFXRXJU1qrbiy0IK2x4J4/kuWZFirk1xYRs3CliRfQ== X-Received: by 10.55.143.198 with SMTP id r189mr14610087qkd.84.1470440958801; Fri, 05 Aug 2016 16:49:18 -0700 (PDT) Received: from ?IPv6:2601:197:200:3353:6029:66a1:74a0:960f? ([2601:197:200:3353:6029:66a1:74a0:960f]) by smtp.gmail.com with ESMTPSA id l22sm10943778qtl.34.2016.08.05.16.49.17 for (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 05 Aug 2016 16:49:17 -0700 (PDT) From: Bo X-Google-Original-From: Bo Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Subject: Please join the Rack Specification discussion for `env['upgrade.websocket']` Message-Id: <58D32D89-4523-436E-8C0E-FA8F4E7AFFB2@plezi.io> Date: Fri, 5 Aug 2016 19:49:17 -0400 To: unicorn-public@bogomips.org Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) X-Mailer: Apple Mail (2.3124) List-Id: Please join the Rack Specification discussion for = `env['upgrade.websocket']` I represent an effort to extend Rack so that it allows server-side = websocket upgrade implementation support and pure Rack websocket = applications. This new Rack feature proposal is gaining support, with over 42 support = votes in the [original Rack discussion = thread](https://github.com/rack/rack/issues/1093). You may have read [my blog post about = this](https://bowild.wordpress.com/2016/07/31/the-dark-side-of-the-rack/) = or [the reddit = discussion](https://www.reddit.com/r/ruby/comments/4vgdlc/the_dark_side_of= _the_rack_and_websockets_dreams/). This proposal simplifies Websocket applications by leaving all the = network complexity were it is (with the application's web server), = allowing application programmers to focus on their application logic. Using [the proposed = specification](https://github.com/boazsegev/iodine/issues/6), a pure = Rack Websocket echo server could be written as simply as: ```ruby # this is a toy example. class MyEcho def initialize(env =3D nil) # optional initialization end def on_message(data) write "Echo: #{data}" end end app =3D Proc.new do |env| if env['upgrade.websocket?'] && env['HTTP_UPGRADE'] =3D~ /websocket/i env['upgrade.websocket'] =3D MyEcho.new(env) # or simply `MyEcho` [ 0, {'X-Header': 'data'}, [] ] else [200, { 'Content-Length' =3D> '12' }, ['He11o World!']] end end run app ``` There's [a working Gist chatroom = example](https://gist.github.com/boazsegev/1466442c913a8dd4271178cab9d98a2= 7). I invite you to join [the = discussion](https://github.com/rack/rack/issues/1093) and help shape the = [proposed specification](https://github.com/boazsegev/iodine/issues/6).