HTTP Server Plugin
HTTP Server plug-in
The Rabbitmq-mochiweb Plugin provides hosting for other plugins that has HTTP interfaces. It allows these interfaces to co-exist in one or more HTTP listeners.
Rabbitmq-mochiweb Plug-ins can provide hosting functionality for other HTTP interfaces to plug-ins. Allow these interfaces to coexist with one or more HTTP listener.
Configuration
How to configure
Plugins using rabbit Mq-mochiweb typically take a listener configuration item to configure their listening HTTP port. In this page we'll give examples for the rabbitmq_management application, but the same configuration can is applied to r Abbitmq_jsonrpc and Rabbitmq_web_stomp_examples.
with Rabbitmq-mochiweb plug-ins, a typical configuration is to configure an HTTP listening port through a listener configuration entry. Here, we will use the Rabbitmq_management application as an example to illustrate, the same configuration can be applied to RABBITMQ_JSONRPC and Rabbitmq_web_stomp to the example.
The listener configuration item can contain the following keys:
The Listener configuration entry can contain the following key values:
- Port (mandatory)
- IP (to listen on only one interface)
- SSL (to enable SSL)
- ssl_opts (To configure SSL)
Listening on a single interface
only listen on a single interface
Use IP to specify an interface for Mochiweb to bind to (giving an IP address as a string or tuple). For example:
You can use IP to specify the interface to which Mochiweb is bound (the IP address is given as a string or tuple), for example:
[{rabbitmq_management, [{listener, [{port, 15672}, {IP, ' 127.0.0.1 '} '}] }].
SSL
Set SSL to True to turn on SSL for a listener. Use the ssl_opts to specify SSL options. These is the standard Erlang SSL Options-see the main page of SSL for more information.
set SSL to True to set a listener to support SSL. The SSL option can be specified with ssl_opts. These options are standard Erlang SSL options-See the man page for SSL.
for convenience, if specify ssl_opts then Rabbitmq-mochiweb would use the same options as the main RABBITMQ Server does for AMQP-over-SSL, but with client certificate verification turned off. If you wish to use client certificate verification, specify ssl_opts explicitly.
in simple use, if you do not set ssl_opts, then Rabbitmq-mochiweb will use the same option as the RABBITMQ server for AMQP over SSL, but the client certificate validation mechanism is turned off. If you want to use the client certificate validation mechanism, you can explicitly set the ssl_opts content.
For Example:
[{rabbitmq_management, [{listener, [{port, 15672}, {SSL, true}, {ssl_opts, [{cacertfile, '/ Path/to/cacert.pem "}, {certfile, "/path/to/cert.pem "}, {keyfile, "/path/to/key.pem "}]} ] } ]}].
"Original" RabbitMQ HTTP server Plugin