# WAMPex
-WAMPex is a client library for the [WAMP protocol](https://wamp-proto.org/index.html)
+WAMPexClient is a client library for the [WAMP protocol](https://wamp-proto.org/index.html). It pairs quite nicely with [WAMPexRouter](https://gitlab.com/entropealabs/wampex_router).
This client library currently implements the [Basic Profile](https://wamp-proto.org/_static/gen/wamp_latest.html#basic-and-advanced-profiles) and some features of the Advanced Profile
```elixir
def deps do
[
- {:wampex,
- git: "https://gitlab.com/entropealabs/wampex",
- tag: "101190dacd9e33f6f445c98c9b5d9e2995d84a93"}
+ {:wampex_client,
+ git: "https://gitlab.com/entropealabs/wampex_client",
+ tag: "59424e0d6a7bbc2646ab1cad9e71a8d27a016ac9"}
]
end
```
A simple [Session](https://wamp-proto.org/_static/gen/wamp_latest.html#sessions) can be configured like so.
```elixir
-alias Wampex.Client.Session
-alias Wampex.Realm
+alias Wampex.Client.{Realm, Session}
alias Wampex.Role.{Callee, Caller, Publisher, Subscriber}
-url = "http://localhost:18080/ws"
+url = "http://localhost:4000/ws"
realm = %Realm{name: "com.myrealm"}
roles = [Callee, Caller, Publisher, Subscriber]
```elixir
alias Wampex.Client.Session
-alias Wampex.Realm
+alias Wampex.Client.Realm
alias Wampex.Role.{Callee, Caller, Publisher, Subscriber}
alias Wampex.Serializer.JSON
-alias Wampex.Transport.WebSocket
+alias Wampex.Client.Transport.WebSocket
url = "http://localhost:18080/ws"
realm = %Realm{name: "com.myrealm"}
## Local Development
-You'll need compliant WAMP Router to run the tests, and do development in general. I recommend the [Bondy Router](https://gitlab.com/leapsight/bondy), it's written in Erlang.
-
-There's a Docker image available, so we'll use that to get up and running quickly.
-
-Make sure you are in the `wampex` directory before running this command.
-
-```bash
-docker run \
- -p 18080:18080 \
- -p 18081:18081 \
- -p 18082:18082 \
- -p 18086:18086 \
- -v $PWD/bondy_config:/bondy/etc \
- -d leapsight/bondy:0.8.8-slim
-```
-
-### Configure Realm
-
-```bash
-curl -X "POST" "http://localhost:18081/realms/" \
- -H 'Content-Type: application/json; charset=utf-8' \
- -H 'Accept: application/json; charset=utf-8' \
- -d $'{
- "uri": "com.myrealm",
- "description": "Test",
- "security_enabled" : false
-}'
-```
-
-This will setup a default realm `com.myrealm`.
-
-This config allows anonymous users as well as authenticated ones. In reality you wouldn't want to enable both, but for testing, it's useful.
-Now we need to add our user for testing authentication.
-
-```bash
-curl -X "POST" "http://localhost:18081/realms/com.myrealm/users" \
- -H 'Content-Type: application/json; charset=utf-8' \
- -H 'Accept: application/json; charset=utf-8' \
- -d $'{
- "username": "entone",
- "password": "test1234"
-}'
-```
-
-### Run the tests
-
-Warning as errors, mix format, Dialyzer, Credo and Coveralls
-
-```bash
-$ MIX_ENV=test mix all_tests
-```
-
-The Router uses CockroachDB
-
-```bash
-$ docker run -p 26257:26257 -p 8080:8080 cockroachdb/cockroach-unstable:v20.1.0-beta.2 start-single-node --insecure
-```
+_COMING SOON_
Happy hacking ;)