Wampire is a asynchronous Web Application Messaging Protcol v2 router library, client library, and a router service, that implements most of the features defined in the advanced profile. The wampire project is written in Rust and designed for highly concurrent asynchronous I/O. The wampire router provides extended functionality. The router and client interaction with other WAMP implementations. Project initially forked from wamp-rs v0.1.0.
- Check the examples/webrtc-simple folder for example using wampire as signaling server for WebRTC connection.
- Free Your Code - Backends in the Browser
- Security in the IoT
- Scaling microservices with Crossbar.io
Alright. So how does WAMP stack up versus other technologies?
Do we really need another wheel? Yes. Please read below to find out why we think so.
Below you’ll find a table comparing WAMP to other technologies according to six criteria:
-
PubSub Does it support Publish & Subscribe out of the box?
-
RPC Does it support Remote Procedure Calls out of the box?
-
Routed RPC Does it support routed (not only point-to-point) Remote Procedure Calls?
-
Web native Does it run natively on the Web (without tunneling or bridging)?
-
Cross Language Does it work from different programming languages and run-times?
-
Open Standard Is there an open, official specification implemented by different vendors?
See also: Web Technologies for the Internet of Things - A master thesis which contains a comparison of WAMP, MQTT, CoAP, REST, SOAP, STOMP and MBWS for IoT applications.
Technology | PubSub | RPC | Routed RPC | Web native | Cross Language | Open Standard |
---|---|---|---|---|---|---|
WAMP | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
AJAX | - | ✔ | - | ✔ | ✔ | - |
AMQP | ✔ | (✔) | - | - | ✔ | ✔ |
Apache Thrift | - | ✔ | - | - | ✔ | - |
Capn’n’Proto | - | ✔ | - | - | ✔ | - |
Comet | - | - | - | ✔ | ✔ | - |
OMG DDS | ✔ | - | - | - | ✔ | ✔ |
D-Bus | ✔ | ✔ | ✔ | - | ✔ | ✔ |
CORBA | ✔ | ✔ | - | - | ✔ | ✔ |
DCOM | ✔ | ✔ | - | - | ✔ | - |
Java JMS | ✔ | - | - | - | - | ✔ |
Java RMI | - | ✔ | - | - | - | ✔ |
JSON-RPC | - | ✔ | - | ✔ | ✔ | ✔ |
MQTT | ✔ | - | - | - | ✔ | ✔ |
OPC-UA | (✔) | ✔ | - | (✔) | ✔ | |
REST | - | ✔ | - | ✔ | ✔ | - |
SOAP | - | ✔ | - | ✔ | ✔ | ✔ |
socket.io | ✔ | - | - | ✔ | - | - |
SockJS | - | - | - | ✔ | ✔ | - |
STOMP | ✔ | - | - | ✔ | ✔ | ✔ |
XML-RPC | - | ✔ | - | ✔ | ✔ | ✔ |
XMPP | ✔ | - | - | ✔ | ✔ | ✔ |
ZMQ | ✔ | - | - | - | ✔ | - |
There a lot of implementations for different languages. Read more..
See the Wampire Project Wiki for full documentation, examples, and operational details.
At present the entire Basic Profile is supported, as well as pattern based subscriptions and registrations from the Advanced Profile.
You may be looking for:
There is currently no support for secure connections.
To include in your project, place the following in your Cargo.toml
[dependencies]
wampire = "0.2"
Wampire uses serde-rs, which requires Rust 1.15 or greater.
To start router in development mode use
RUST_LOG=info cargo run wampire
To pass WebSocket connection to router add it to Nginx config. PS. can be used with SSL too.
location /ws/ {
proxy_pass http://127.0.0.1:8090;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_read_timeout 1800s;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
Build router:
- Clone repo using
git clone https://github.com/ohyo-io/wampire.git
cd wampire && cargo build
- Copy
wampire
fromtarget
folder to/usr/local/bin
- Copy
wampire.service
fromdist
to/usr/lib/systemd/system
or/lib/systemd/system
(depend on your system).
To start a service:
systemctl start wampire
To enable as system service:
systemctl enable wampire
Please see the examples directory. For instructions on how to check the examples
RUST_LOG=info cargo run --example api_user
RUST_LOG=info cargo run --example endpoint
RUST_LOG=info cargo run --example pubsubclient
See FEATURES for details.
Wampire provides extended functionality
around subscriber black/white listing and in the information available via the session meta API.
This enhances the ability of clients to make desisions about message recipients.
Wampire is an MIT-licensed open source project. It's an independent project with its ongoing development made possible entirely thanks to the support by these awesome backers. If you'd like to join them, please consider:
This work is licensed under the MIT license. See LICENSE for details.