Table of Contents
Erwa is the implementation of the WAMP protocol in Erlang. It supports the router, so the server side.
Pull Requests, Bug Reports, Comments and any other kind of feedback is welcome.
Erwa has the following features:
- the complete basic profile revision RC4
- Advanced Profile (only listing stable/implemented)
- RawSocket Transport
- Batched Websocket Transport
- Feature Announcement
- Agent Identification
- Subscriber Black-and Whitelisting
- Publisher Exclusion
- Publisher Identification
- Progressive Call Results
- Cancelling Calls
- Call Timeouts
- Caller Identification
- NOT yet supported
- LongPoll Transport
- Challenge Response Authentication (Database needs to be implemented by user)
The router implementation in Erwa uses the great ranch and cowboy from Loïc Hoguin (essen) to handle the incomming connections and the webserver part for the websockets. Erwa has two modules to work either as a protocol for ranch on incomming TCP connections, or as websocket handler with cowboy on incomming websocket connections.
All you need to do to get a simple WAMP router up and running is to add a dispatch rule to ranch and/or cowboy:
A WAMP router on websockets:
%% start erwa to handle any incomming connections to any host at the path /wamp %% start it with 100 parallel acceptors on port 8080 ok = erwa:start_websocket("/wamp", 8080, 100).
The other possibility is to start Erwa as a TCP router:
%% start erwa listening for raw tcp connections on port 5555 %% starting it with 5 parallel acceptors ok = erwa:start_socket(5555,5).
This is also included in the simple_router example in the examples directory.
By default Erwa does not automatically create realms. This is activated by the boolean autocreate_realm flag. If you only want to support certain realm you need to start them by using erwa:start_realm/1, which takes the name of the realm to start as argument.
In the exampes directory you can find a simple router example:
- simple_router: A very tiny example, showing how easy it is to fire up a WAMP router using Erwa.
The MIT License (MIT)
Copyright (c) 2014-2015 Bas Wegh
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Back to TOC