Skip to content

Commit

Permalink
Merge pull request #45 from esl/fix-pick-server-comment
Browse files Browse the repository at this point in the history
Fix comment about xmpp_servers
  • Loading branch information
chrzaszcz authored Mar 3, 2025
2 parents 7379591 + 275ad15 commit 142c0f1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/helpers/amoc_xmpp.erl
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,12 @@ maybe_use_legacy_tls(Spec) ->
%% @doc Picks a random server based on the config var `xmpp_servers'.
%% This function expects a list of proplists defining the endpoint
%% to which an XMPP client can connect, for instance:
%% [[{host, "127.0.0.1"}, {port, 5222}], [{host, "127.0.0.1"}, {port, 5223}]]
%% [[{host, <<"127.0.0.1">>}, {port, 5222}], [{host, <<"127.0.0.1">>}, {port, 5223}]]
%% One of the above proplists is picked and can be added to user's spec.
%% It's required that the proplists contains at least the `host' property.
%% Since the `xmpp_servers' config option is read via `amoc_config' API,
%% it's possible to pass it as an ENV var when starting amoc:
%% ```> AMOC_xmpp_servers="[[{host,\"127.0.0.2\"}, {port, 5222}],[{host, \"127.0.0.1\"}, {port, 5223}]]" make console'''
%% ```> AMOC_XMPP_SERVERS="[[{host,<<\"127.0.0.2\">>}, {port, 5222}],[{host, <<\"127.0.0.1\">>}, {port, 5223}]]" rebar3 shell'''
-spec pick_server([[proplists:property()]]) -> [proplists:property()].
pick_server(DefaultServers) ->
Servers = amoc_config:get(xmpp_servers, DefaultServers),
Expand Down

0 comments on commit 142c0f1

Please sign in to comment.