Skip to content
This repository was archived by the owner on Nov 16, 2020. It is now read-only.

Commit efcdd51

Browse files
committed
Retrieve ws path from config
1 parent 265643f commit efcdd51

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

priv/schema/rabbitmq_web_mqtt.schema

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
{mapping, "web_mqtt.num_acceptors.tcp", "rabbitmq_web_mqtt.num_tcp_acceptors",
1+
{mapping, "web_mqtt.num_acceptors.tcp", "rabbitmq_web_mqtt.num_tcp_acceptors",
22
[{datatype, integer}]}.
3-
{mapping, "web_mqtt.num_acceptors.ssl", "rabbitmq_web_mqtt.num_ssl_acceptors",
3+
{mapping, "web_mqtt.num_acceptors.ssl", "rabbitmq_web_mqtt.num_ssl_acceptors",
44
[{datatype, integer}]}.
55

66
{mapping, "web_mqtt.tcp.backlog", "rabbitmq_web_mqtt.tcp_config.backlog",
@@ -11,6 +11,8 @@
1111
[{datatype, string}, {validators, ["is_ip"]}]}.
1212
{mapping, "web_mqtt.tcp.port", "rabbitmq_web_mqtt.tcp_config.port",
1313
[{datatype, integer}]}.
14+
{mapping, "web_mqtt.ws_path", "rabbitmq_web_mqtt.ws_path",
15+
[{datatype, string}]}.
1416

1517
{translation,
1618
"rabbitmq_web_mqtt.tcp_config",
@@ -67,4 +69,3 @@
6769
[{datatype, integer}]}.
6870
{mapping, "web_mqtt.cowboy_opts.timeout", "rabbitmq_web_mqtt.cowboy_opts.timeout",
6971
[{datatype, integer}]}.
70-

src/rabbit_web_mqtt_app.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ mqtt_init() ->
4848
CowboyOpts0 = get_env(cowboy_opts, []),
4949

5050
Routes = cowboy_router:compile([{'_', [
51-
{"/ws", rabbit_web_mqtt_handler, []}
51+
{get_env(ws_path, "/ws"), rabbit_web_mqtt_handler, []}
5252
]}]),
5353
CowboyOpts = maps:from_list([
5454
{env, #{dispatch => Routes}},

0 commit comments

Comments
 (0)