Skip to content
This repository

Jun 20, 2013

  1. Steve Vinoski

    changes for R16B01

    In R16B01, crypto:sha/1 is deprecated in favor of crypto:hash/2, but the
    latter is not available prior to R15B02. Change the configure script and
    rebar support to look for crypto:hash/2 and use it if found, otherwise fall
    back to crypto:sha/1.
    
    Also in R16B01 the public_key application, used by some of the tests, now
    requires the asn1 application to be started first. Change the tests to
    accommodate that.
    vinoski authored
  2. Karolis Petrauskas

    Use crypto:hash instead of crypto:sha to be compatible with R16B1.

    kape1395 authored

Apr 08, 2013

  1. Claes Wikstrom

    General whitespace and indent cleanup, removed trailing whitespace an…

    …d constrained code to 80 cols
    authored

Feb 11, 2013

  1. Christopher Faulet

    Refactor WebSockets and add support of optional callback functions

    Main changes:
      * Fix some bugs about UTF-8 encoding and messages fragmentation
      * Add support of optional callback functions
      * Add support of many startup options
      * Add support of outgoing fragmented messages
      * Add a websocket testsuite
    
                                     - * -
    *** bug fixes ***
    
    First of all, an huge part of yaws_websocket.erl was rewritten to fix bugs
    about the messages fragmentation and the UTF-8 encoding of incoming text
    messages:
    
      * UTF-8 encoding
        before, when a text message was fragmented, only the first frame was
        checked and partial UTF-8 sequences were not supported. Now, checks
        are done on each message part and a partial UTF-8 sequence at the end
        of a frame is accumulated and checked with the next frame (for basic
        callback only).
    
      * Messages fragmentation
        for basic callback modules, because of a buggy mapping between frames
        and messages, the messages fragmentation was almost unusable. To fix
        this, the message handling was rewritten.
    
    Now, all tests in the autobahn testsuite[1] pass successfully.
    
                                     - * -
    *** Optional callback functions ***
    
    Then, from an idea of François de Metz[2], yaws_websocket module was
    extended to support optional callback functions. See the documentation for
    details (www/websockets.yaws).
    
    Quickly, optional callback functions are:
    
      * Module:init/1           (for basic and advanced callback modules)
      * Module:terminate/2      (for basic and advanced callback modules)
      * Module:handle_open/2    (for basic and advanced callback modules)
      * Module:handle_info/2    (for basic and advanced callback modules)
      * Module:handle_message/2 (for basic callback modules only, used in place
                                 of Module:handle_message/1)
    
    Thanks to Pablo Vieytes[3] which added handle_info to optional callback
    functions.
                                     - * -
    *** Startup options ***
    
    To start a websocket process a script must return the following term from
    its out/1 function:
    
      {websocket, CallbackMod, Options}
    
    where 'Options' is a (possibly empty) proplist. Following parameters are
    supported:
    
      * {origin, Orig}
      * {callback, Type}
      * {keepalive, Boolean}
      * {keepalive_timeout, Tout}
      * {keepalive_grace_period, Time}
      * {drop_on_timeout, Boolean}
      * {close_timeout, Tout}
      * {close_if_unmasked, Boolean}
      * {max_frame_size, Int}
      * {max_message_size, Int}
      * {auto_fragment_message, Boolean}
      * {auto_fragment_threshold, Int}
    
    See the documentation for details (www/websockets.yaws).
    
                                     - * -
    *** Outgoing fragmented messages ***
    
    A callback module can now send fragmented messages to clients using the
    record #ws_frame{}:
    
     #ws_frame{fin     = true,  %% true | false
               rsv     = 0,
               opcode,          %% text | binary | continuation...
               payload = <<>>}. %% binary(), unmasked data
    
    --
    [1] http://autobahn.ws/testsuite
    [2] #99
    [3] https://github.com/pvieytes
    capflam authored

Oct 23, 2012

  1. Ahti Legonkov

    Fix bug #128 and add a new test case for it

    leg0 authored vinoski committed

Oct 22, 2012

  1. Steve Vinoski

    keep websocket errors from crashing gen_server

    Change websocket implementation to not stop abnormally or crash with noisy
    logs if errors occur.
    vinoski authored

Oct 02, 2012

  1. Christopher Faulet

    Fix SSL socket wrapping

    We must be careful when we rely on Arg#arg.clisock in Yaws modules
    because the socket is wrapped in case of SSL connections.
    
    Thanks to Jean-Charles Campagne.
    capflam authored vinoski committed

Jul 10, 2012

  1. Steve Vinoski

    wrap SSL sockets in tuple

    Yaws previously internally used details of an SSL socket representation
    that's supposed to be private/opaque to Erlang's SSL support. Encapsulate
    SSL sockets within a {ssl, SslSocket} tuple and add the
    yaws_api:get_sslsocket/1 function that returns a socket for SSL sockets or
    undefined for non-SSL sockets. Also document the new get_sslsocket/1
    function and other minor tweaks to SSL areas of the documentation.
    vinoski authored

Jun 21, 2012

  1. Steve Vinoski

    add reverse proxy intercept module capability

    Users can now specify an interception module that can rewrite requests and
    responses as they pass through the Yaws reverse proxy. See the
    documentation for details (yaws.conf.5 man page or the yaws.pdf file).
    
    Also add new set_header, get_header, and delete_header functions to the
    yaws_api module to allow intercept modules and arg rewriters to more easily
    examine and modify #headers{} records.
    
    Add new tests for the new header manipulation functions and for the reverse
    proxy interception feature.
    vinoski authored

Jun 02, 2012

  1. Steve Vinoski

    fix websockets reply status codes for client close messages

    A number of autobahn WebSockets tests were failing due to replies
    containing incorrect status codes. Check client status codes and reply with
    correct codes.
    vinoski authored
  2. Steve Vinoski

    refactor yaws_websockets as a gen_server

    The yaws_websockets module used an explicit recursive loop. Refactor it to
    use a gen_server instead.
    vinoski authored

Apr 22, 2012

  1. Steve Vinoski

    add callback for abnormal websocket close

    If a websocket client closes the connection abnormally, issue a callback to
    the application callback module indicating the closure.
    vinoski authored

Feb 12, 2012

  1. Steve Vinoski

    add close callback for websockets

    WebSocket clients can close their end of the connection, and RFC 6455
    requires servers to handle that message appropriately. This change
    adds a new callback message for basic WebSocket callback modules. The
    server now also replies to client "close" messages with a "close"
    reply, as RFC 6455 requires. WebSockets documentation updated as well.
    
    Also included a message ordering fix from Jan Bothma.
    vinoski authored

Feb 10, 2012

  1. Steve Vinoski

    minor cleanup

    vinoski authored

Dec 18, 2011

  1. JD Bothma

    update WebSockets implementation to support RFC 6455

    This change allows websocket connections to be set up between browsers
    and the yaws server. RFC 6455 for WebSocket connections is supported,
    in addition to the hybi working group RFC drafts 10 to 17.
    
    The quickest way to try this out is by compiling yaws as usual, then
    visiting /websockets_example.yaws at the default local installation
    host. This can be done using Google Chrome 14+, Firefox 7+ or any
    other browser supporting WebSocket version 8 or above. Information
    about getting started with WebSockets using this implementation is
    given in /websockets.yaws.
    
    This drops support for the older draft RFCs, specifically those of the
    hixie working group which were previously supported by yaws but are
    significantly different from the hybi working group's specification.
    
    The interface for using WebSocket with yaws has changed
    somewhat. Instead of spawning a websocket owner process which
    maintains a server loop such as that shown in the old
    websockets_endpoint.yaws, the application developer now implements a
    callback module such as those in src/basic_echo_callback.erl or
    src/advanced_echo_callback.erl -- the difference being that the
    advanced callback style is only necessary if you need advanced
    features of WebSocket such as fragmented messages. One suggested way
    to deploy your callback module and its dependencies is as part of an
    application in an OTP release, with yaws as a dependency. Rebar can be
    used to build the dependencies, fetch and build yaws, and create a
    release which will ensure the modules are in the path of the runtime
    system.
    
    Most behaviour tested by the Autobahn test suite 0.43 pass when
    configured to connect to the /websockets_autobahn_endpoint.yaws and
    /websockets_example_endpoint.yaws over an unencrypted
    connection. Significantly, websocket connection closing is not
    implemented and the socket is left to be cleaned up by the Runtime
    System when either the connection is lost or the owning processes
    dies. Secondly, certain cases where websocket frames are fragmented
    within UTF-8 code points cause the check for valid text type messages
    to incorrectly fail the connection.
    
    Subprotocols are not currently supported.
    
    Augment yaws.tex with a new WebSocket Protocol chapter (Steve
    Vinoski).
    jbothma authored vinoski committed

Apr 20, 2011

  1. Steve Vinoski

    major trailing whitespace cleanup

    Remove trailing whitespace in all .erl and .hrl files in the
    repository.
    
    If you're an emacs user, you can easily see trailing whitespace using
    settings like these in your ~/.emacs file:
    
    (setq-default show-trailing-whitespace t)
    (set-face-background 'trailing-whitespace "slate gray")
    
    You can also delete trailing whitespace automatically when you save
    your Erlang sources by setting the emacs before-save-hook in your
    ~/.emacs file like this:
    
    (add-hook 'before-save-hook
              '(lambda () (if (eq major-mode 'erlang-mode)
                              (delete-trailing-whitespace))))
    vinoski authored

Mar 03, 2011

  1. Claes Wikstrom

    indendation cleanup

    authored

Oct 24, 2010

  1. Dan Willemsen

    fix SSL Websocket support (Dan Willemsen)

    fixed a case where a gen_tcp call was erroneously being used on an SSL
    socket
    danw authored vinoski committed

Sep 01, 2010

  1. Steve Vinoski

    for portability, use erlang:md5 rather than crypto md5

    Since OpenSSL availability on Windows for working with the crypto
    module is apparently questionable, use the erlang:md5 function in
    place of the crypto md5 functions.
    vinoski authored

Aug 28, 2010

  1. Steve Vinoski

    minor code cleanup

    vinoski authored

Aug 27, 2010

  1. Dominique Boucher

    Reverted some names to ease merge.

    schemeway authored
  2. Dominique Boucher

    Added support for websockets v76.

    schemeway authored

Jan 12, 2010

  1. Claes Wikstrom

    no utf8 in the author name

    authored

Dec 18, 2009

  1. Davide

    Get the websocket return value to enforce #outh{doclose=false} using …

    …the {connection, erase} header.
    davide authored
  2. Davide

    HTML5 Web Sockets support.

    davide authored
Something went wrong with that request. Please try again.