From: Christopher Date: Sat, 21 Mar 2020 01:03:03 +0000 (-0500) Subject: update README X-Git-Url: http://git.entropealabs.com/?a=commitdiff_plain;h=1ead266a616bbea61ffd77175884015e0ee16690;p=wampex_client.git update README --- diff --git a/README.md b/README.md index 1985eac..e75b9e8 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # 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 @@ -85,9 +85,9 @@ Currently it's not available on hex.pm. I want to get a little more real-world t ```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 ``` @@ -109,11 +109,10 @@ WAMPex defaults to WebSocket as the transport and MessagePack as the serializati 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] @@ -130,10 +129,10 @@ You can override the default serializer and transport like this. ```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"} @@ -158,63 +157,7 @@ You can copy and paste the JSON into the JSON input at https://citybaseinc.githu ## 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 ;)