Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Commits on Jul 25, 2012
  1. @capflam

    Make the mime types mappings configurable

    Christopher Faulet authored capflam committed
    Now, it possible to customize the global mime types mappings and to overload
    it for each virtual server. It can be done using following directives in the
    global part or the server part of the configuration:
    
    * default_type: Defines the default mime type to be used where Yaws cannot
      determine it by its mime types mappings (default: text/plain).
      In the server part, this directive overloads the global one.
    
    * default_charset: Defines the default charset to be added when a response
      content-type is text/* (default: none). In the server part, this directive
      overloads the global one.
    
    * mime_types_file: Overrides the default mime.types file included with Yaws
      (default: ${PREFIX}/lib/yaws/priv/mime.types). In the server part, this
      directive overloads the global one but mappings defined in this file will
      not overload those defined by add_types directives in the global part.
    
    * add_types: Specifies one or more mappings between mime types and file
      extensions. More than one extension can be assigned to a mime type. If a
      mapping is defined in the global part and redefined in a server part using
      this directive, then the later is used. Else the global one is kept.
    
    * add_charsets: Specifies one or more mappings between charsets and file
      extensions. More than one extension can be assigned to a charset. If a
      mapping is defined in the global part and redefined in a server part using
      this directive, then the later is used. Else the global one is kept.
    
    Here is an example:
    
      default_type = text/html
    
      <server localhost>
          port = 8000
          listen = 0.0.0.0
          docroot = /var/www
          # nothing is overloaded in the vhost
      </server>
    
      <server localhost>
          port = 8001
          listen = 0.0.0.0
          docroot = /var/www
    
          # overload global configuration:
          default_type    = text/plain
          mime_types_file = /etc/mime.types
          add_types       = <text/xhtml, yaws> <application/x-test, tst test>
          default_charset = UTF-8
          add_charsets    = <ISO-8859-1, php html yaws> <US-ASCII, tst>
      </server>
    
    During Yaws compilation, a default module 'mime_types' is created using the
    default mime.types file. Then, when yaws starts up, this module is
    re-generated, re-compiled and loaded dynamically. The new module replaces the
    default one but the .beam file is unchanged. So if one of these steps failed,
    we fall back on the default module.
Commits on Jul 11, 2012
  1. Add index_files directive into the server part configuration

    Christopher Faulet authored
    This directive sets the list of resources to look for, when a directory is
    requested by the client. If the last entry begins with a "/", and none of
    the earlier resources are found, Yaws will perform a redirect to this uri.
    
    Default is:
      index_files = index.yaws index.html index.php
Commits on Jul 10, 2012
  1. @vinoski

    wrap SSL sockets in tuple

    vinoski authored
    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.
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 Jun 21, 2012
  1. @vinoski

    add reverse proxy intercept module capability

    vinoski authored
    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.
Commits on Jun 16, 2012
  1. @vinoski

    minor fixes to yaws.tex

    vinoski authored
Commits on Jun 11, 2012
  1. @vinoski

    fix overfull hbox warnings in yaws.tex

    vinoski authored
    Fix overfull hboxes and also update some of the record definitions (like
Commits on May 11, 2012
  1. Add support for precompressed static files

    Christopher Faulet authored
    By setting use_gzip_static to true in deflate options, in a vhost
    configuration, It is possible to serve precompressed versions of
    static files. Yaws will look for precompressed files in the same
    location as original files that end in ".gz".
    
    Only files that do not fit in the cache are concerned and the mtime
    of a precompressed file must be higher than the one of original file.
Commits on May 3, 2012
  1. Make the parameter "x_forwarded_for_log_proxy_whitelist" obsolete

    Christopher Faulet authored
    This parameter is now ignored and throws a warning when yaws starts.
    If necessary, it can be replaced by a simple logger_mod on top of
    yaws_log. To explain how to write such module, an example was added
    into the www directory (www/logger_mod.yaws).
Commits on May 2, 2012
  1. doc update

    authored
Commits on Apr 25, 2012
  1. Add options to configure deflate compression behaviour

    Christopher Faulet authored
    By adding "<deflate> ... </deflate>" structure in vhosts configuration,
    it is possible to configure how deflate compression will be applied
    and when it will come into effect. Now we can:
    
     * define the smallest response size that will be compressed
     * define the compression level to be used
     * specify the zlib compression window size
     * specify how much memory should be allocated for the internal
       compression state
     * choose the strategy used to tune the compression algorithm
    
    All these parameters are used when a zlib stream is initialized for
    compression.
    
    It is also possible to define all compressible mime types.
    Here is an example:
    
    <server localhost>
      ...
      deflate = true
      <deflate>
        min_compress_size = 4096
        compression_level = best_compression
        mime_types        = defaults, image/*
        mime_types        = application/xml, application/xhtml+xml, application/rss+xml
        mem_level         = 9
        strategy          = default
        window_size       = 15
      </deflate>
      ...
    </server>
  2. Update yaws.tex to have the same description of the config file...

    Christopher Faulet authored
    ...than in the manpage yaws.conf.5
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 Mar 17, 2012
  1. @vinoski
  2. @vinoski

    add description of "yaws --running-config"

    vinoski authored
    Add description of "yaws --running-config" to the Embedded Mode
    chapter of yaws.tex.
Commits on Feb 15, 2012
  1. Fix issue #88

    Christopher Faulet authored
    2 changes here:
    
     * Revert "Flush remaining data when dynamic content is delivered"
    
    This reverts commit d09ed3d.
    Systematically flushing data is not a good idea.
    
     * Add "flush" as possible return value of the out/1 function
    
    Some clients (eg. Firefox and google-chome...) do not handle connection
    close gracefully when the connection is closed during sending data; they
    do not read the server response. So, when the response is important, to
    warn the end-user that an error occured for example, we must be fair by
    flushing data before closing the connection.
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 Feb 10, 2012
  1. @vinoski

    minor cleanup

    vinoski authored
Commits on Feb 2, 2012
  1. Allow the server signature to be defined per virtual server

    Christopher Faulet authored
    Now, we can use the 'server_signature' directive into the server part
    to overload the global one for specific virtual server.
Commits on Jan 18, 2012
  1. @sgolovan @vinoski

    fixes for make clean in applications and doc dirs

    sgolovan authored vinoski committed
    * applications/wiki/scripts/Makefile: Remove all scripts on make
      clean.
    * applications/yapp/Makefile: Remove forgotten PNG image on make
      clean.
    * doc/Makefile: Remove generated www/yaws.ps and www/yaws.pdf on
      make clean.
Commits on Jan 9, 2012
  1. Merge remote-tracking branch 'capflam/trace_improvements'

    authored
    Conflicts:
    	src/yaws_server.erl
Commits on Jan 6, 2012
  1. Update documentation accordingly

    Christopher Faulet authored
  2. Update documentation and manpages accordingly

    Christopher Faulet authored
  3. Update documentation about docroot directive

    Christopher Faulet authored
Commits on Dec 18, 2011
  1. @jbothma @vinoski

    update WebSockets implementation to support RFC 6455

    jbothma authored vinoski committed
    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).
Commits on Oct 31, 2011
  1. @vinoski

    whitespace cleanup

    vinoski authored
    Remove all trailing whitespace from all text files. Some bot sent
    Klacke and me a pull request saying it had done this for us, but I
    reviewed the diffs and it was affecting lines that shouldn't have been
    affected, so perl and I did it ourselves instead.
Commits on Oct 1, 2011
  1. @vinoski

    remove obsolete username config from yaws.tex

    vinoski authored
    The "username" global config setting was removed from the code ages
    ago but it was still in the LaTeX doc. Remove it.
Commits on Sep 26, 2011
  1. @vinoski

    add config setting for acceptor pool size

    vinoski authored
    Add new config setting to allow the size of the acceptor process pool
    to be set to something other than the default. The default size is the
    same as what it was prior to this change. Also add documentation for
    the new setting, and augment the yaws.conf.template with information
    about it.
  2. @vinoski

    document process_options config setting

    vinoski authored
    The process_options config setting was not documented, so add it to
    yaws.tex.
  3. @vinoski
  4. @vinoski

    allow functions to be specified as values in ehtml

    vinoski authored
    Ehtml now allows functions to be used as values. You can specify a
    function value as an anonymous arity 0 function, or as a tuple
    consisting of a module, function name, and argument list (i.e.,
    {M,F,[Args]}). Functions must return valid ehtml values, and they may
    return other functions as long as those functions eventually return a
    valid non-function ehtml value.
    
    Augment yaws.tex to document this new feature. Add a new eunit test
    for the feature as well.
Commits on Sep 14, 2011
  1. @vinoski
Commits on May 24, 2011
  1. @vinoski

    allow Server header customization (capflam)

    Christopher Faulet authored vinoski committed
    Add the server_signature directive in the global part of configuration
    to allow users to customize the HTTP Server header.
  2. @vinoski

    add shaper directive to control access (capflam)

    Christopher Faulet authored vinoski committed
    inspired by the mod_bwshare module of Apache, add the shaper directive
    to control access to virtual servers. Access can be controlled based
    on the client's IP address. It is also possible to throttle HTTP
    requests based on the client's download rate. External modules used to
    shape the traffic must implement the new behaviour yaws_shaper.
Something went wrong with that request. Please try again.