nats-io / elixir-nats

Elixir NATS client
MIT License
76 stars 14 forks source link

README.MD Authentication example is broken #42

Closed synepis closed 6 years ago

synepis commented 6 years ago

The readme.md file states you should pass the authentication parameters like so (as atoms): nats_conf = %{host: "some-host", port: 3222, auth: %{ user: "some-user", pass: "some-pass"}}

If you try to do this, the app will blow up since the json encoder cannot handle atoms:

Interestingly, if you look into the tests they set the auth parameters differently: opts = %{ auth: %{ "user" => "user", "pass" => "pass"}, }

So, the encoder needs to handle atoms correctly, or the readme.md needs to be changed to reflect how to pass the arguments correctly.

P.S. why not add an example with auth_token as well to the readme.md?