Middlewares are built-in, auxiliary software components adaptable to suit specific needs. These components are normally disabled (with the exception of file serving) and must be enabled at run-time. See respective section for details on how to activate and configure a component.
RabbitMQ is a a messaging system based on the Advanced Message Queuing Protocol – an emerging standard for multi-purpose, asynchronous message delivery. The AMQP middleware integrates Trombone with RabbitMQ and makes it possible for third-party applications to receive notifications when server resources are modified.
|Enable with --amqp[=USER:PASS] or -A and, optionally, supply a host name using
--amqp-host[=HOST] (if you leave out this option, localhost is assumed).
When a request of type POST, PUT, DELETE, or PATCH is accepted and produces a regular 200 OK response, a subsequent message is published to an exchange managed by the server.
Trombone AMQP Exchange¶
Messages follow the format <method> <uri>:<response-body>; e.g.,
To configure and run RabbitMQ with STOMP Over WebSocket enabled, follow these instructions to install the Web-Stomp plugin.
For more information on STOMP Over WebSocket, see http://jmesnil.net/stomp-websocket/doc/.
For this example, you need stomp.js, and sock.js.
The CORS component provisions Trombone with the ability to accept cross-domain requests. It implements the handshake and response headers mandated by CORS-compliant client applications, such as modern web browsers.
CORS involves coordination between both server and client. For more information regarding client requirements, as well as cross-origin resource sharing in general, please see: enable-cors.org.
|Enable using --cors or -C.|
The logging format is similar to Apache’s log file output.
|Enable using --access-log[=FILE] or -l, and specify --colors to enable
colors in the log file.
Static File Serving¶
Trombone can also act as a simple file server. Files located under the public/ directory or any of its subdirectories are HTTP accessible.
public/image.png <~> http://localhost:3010/image.png