Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Commits on Jul 7, 2014
  1. Massive autotools refactoring & cleanup

    Christopher Faulet authored
    Now, all makefile are generated by automake. This way, many things are more
    configurable and maintainable.
    
    Main (visible) changes:
    
     * Now, you can configure and compile Yaws outside the source directory. It is
       also possible to generate an archive for distribution, using the 'dist' target
       (from now, 'distcheck' target should always pass).
    
     * We track .erl dependencies using '-M*' flags of ERLC.
    
     * generated header 'yaws_configure.hrl' disappears. HAVE_SENDFILE,
       HAVE_ERLANG_SENDFILE and HAVE_CRYPTO_HASH macros are defined in ERLC flags.
    
     * yaws_generated:localinstall/0 function disappears (see comment about local
       install).
    
     * To create a windows installer, we just need to run the 'mkinstaller'
       target. Read win32/README.developer for details.
    
     * We use standard Erlang installation path for Yaws, relative to the erlang
       library directory (/usr/lib/erlang/lib). Now, '$(libdir)/yaws' is a link. We
       do the same for yapp application.
    
     * "local install" was removed. Now, to do a "developer install", we just need
       to set a prefix during the project configuration using --prefix option. So,
       you need to install yaws to test it.
    
     * DESTDIR variable is still supported.
    
     * scripts/make-release was rewritten to use 'dist' and 'mkinstaller' targets.
    
     * Installation of Yaws applications has slightly changed. Now they are
       installed in their own directory, in '$(localstatedir)/yaws'. So, chat
       application will be installed in '$(localstatedir)/yaws/chat', with 'www' and
       'ebin' subdirs.
    
    Main targets (others than all/install/clean....):
    
      * all           : compile Yaws
      * debug         : compile Yaws with debug flags
      * clean         : remove files produced by all or debug target
      * install       : do a proper install of Yaws
      * doc or docs   : build the documentation
      * check or test : launch tests
      * cleantest     : remove files produced by check target
      * dialyzer      : run dialyzer on Yaws
      * mkinstaller   : build an installer for windows
      * cleaninstaller: remove files produced by mkinstaller target
      * apps          : compile Yaws applications (chat,mail,wiki,yapp)
      * cleanapps     : remove files produced by apps target
      * installapps   : install Yaws applications
      * fullinstall   : install + installapps
      * fullclean     : clean + cleantest + cleanapps + cleaninstaller
    
      To install an application, run: (cd application/{APP} && make install)
    
    Of course, many things can be customized during configuration and Rebar still
    works as expected. To do an install with (almost) the same tree than with
    previous of Yaws, do:
    
      $> ./configure yawsdir=${prefix}/lib/yaws yappdir=${prefix}/lib/yapp \
            --sysconfdir=/etc --localstatedir=/var
      $> make install
    
    Here is the default installation tree on my debian:
    
       usr
        ├── lib
        │   └── erlang
        │       └── lib
        │           ├── yapp-0.4.2
        │           │   ├── doc/
        │           │   ├── ebin/
        │           │   ├── examples/
        │           │   └── priv/docroot/
        │           └── yaws-1.98
        │               ├── ebin/
        │               ├── include/
        │               └── priv/
        │               ├── examples/
        │
        ├── local/bin/yaws
        │
        ├── local/etc/init.d/yaws
        ├── local/etc/yaws/
        ├── local/etc/mail/yaws-webmail.conf
        │
        ├── local/lib/pkgconfig/yaws.pc
        ├── local/lib/yapp -> /usr/lib/erlang/lib/yapp-0.4.2
        ├── local/lib/yaws -> /usr/lib/erlang/lib/yaws-1.98
        │
        ├── local/share/doc/yaws/yaws.pdf
        ├── local/share/man/{man1,man5}/
        │
        ├── local/var/log/yaws
        ├── local/var/run/yaws
        └── local/var/yaws
            ├── chat/{ebin,www}
            ├── mail/{ebin,www}
            ├── wiki/{ebin,www}
            └── www
Commits on Feb 11, 2013
  1. Refactor WebSockets and add support of optional callback functions

    Christopher Faulet authored
    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
Commits on Jan 3, 2013
  1. Add access functions for #gconf{} and #sconf{} records

    Christopher Faulet authored
    Applications may want to retrieve information in it. yaws:gconf_*/1 and
    yaws:sconf_*/1 should be used in preference to a direct access to reduce
    the dependence of your code on these records. So internal modifications
    could be done avoiding the need to update and recompile your application.
    
    Update www/internals.yaws accordingly and remove dependency on 'yaws.hrl'
    in examples and applications. Add unit tests to check #gconf{} and #sconf{}
    setup.
Commits on Jul 12, 2012
  1. @vinoski
Commits on Jul 6, 2012
  1. @vinoski

    minor changes to server-sent events

    vinoski authored
    Change yaws_sse to send close connection header by default, and change the
    example to return an Allow header if anything other than GET is requested.
Commits on Jun 29, 2012
  1. @vinoski
Commits on Jun 26, 2012
  1. @vinoski

    use localtime not universaltime for server_sent_events example

    vinoski authored
    Looks like httpd_util:rfc1123_date/1 wants local time, not UTC time, as its
    time argument. The server_sent_events example uses that function to create
    the server date string events.
Commits on Jun 25, 2012
  1. @vinoski

    add support for W3C Server-Sent Events

    vinoski authored
    Server-Sent Events is a W3C working draft allowing servers to send simple
    events to a client. See the documentation in www/server_sent_events.yaws
    for a full description.
Commits on Apr 22, 2012
  1. @vinoski

    add callback for abnormal websocket close

    vinoski authored
    If a websocket client closes the connection abnormally, issue a callback to
    the application callback module indicating the closure.
Commits on Feb 17, 2012
  1. @vinoski

    clean up rebar build problems with examples/src

    vinoski authored
    Clean up some duplicate options and extra whitespace in
    examples/src/Makefile, and add examples/src to rebar.config to make
    sure it gets built under rebar.
Commits on Feb 13, 2012
  1. Fixed issue 87

    authored
Commits on Feb 12, 2012
  1. @vinoski

    add close callback for websockets

    vinoski authored
    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.
Commits on Jan 2, 2012
Commits on Feb 9, 2010
  1. release work

    authored
Commits on Dec 6, 2009
  1. preparing for 1.86

    authored
Commits on Nov 25, 2002
  1. ""

    authored
    git-svn-id: https://erlyaws.svn.sourceforge.net/svnroot/erlyaws/trunk/yaws@306 9fbdc01b-0d2c-0410-bfb7-fb27d70d8b52
Something went wrong with that request. Please try again.