diff --git a/apps/block_scout_web/config/config.exs b/apps/block_scout_web/config/config.exs index edcac0d8c9..4fcb422d86 100644 --- a/apps/block_scout_web/config/config.exs +++ b/apps/block_scout_web/config/config.exs @@ -38,6 +38,11 @@ config :logger, :block_scout_web, metadata: [:application, :request_id], metadata_filter: [application: :block_scout_web] +config :wobserver, + # return only the local node + discovery: :none, + mode: :plug + # Import environment specific config. This must remain at the bottom # of this file so it overrides the configuration defined above. import_config "#{Mix.env()}.exs" diff --git a/apps/block_scout_web/lib/block_scout_web/endpoint.ex b/apps/block_scout_web/lib/block_scout_web/endpoint.ex index ec014adf29..54d2d9abdd 100644 --- a/apps/block_scout_web/lib/block_scout_web/endpoint.ex +++ b/apps/block_scout_web/lib/block_scout_web/endpoint.ex @@ -6,6 +6,7 @@ defmodule BlockScoutWeb.Endpoint do end socket("/socket", BlockScoutWeb.UserSocket) + socket("/wobserver", Wobserver.Web.PhoenixSocket) # Serve at "/" the static files from "priv/static" directory. # diff --git a/apps/block_scout_web/lib/block_scout_web/router.ex b/apps/block_scout_web/lib/block_scout_web/router.ex index cc18314f4b..44e2b90bd3 100644 --- a/apps/block_scout_web/lib/block_scout_web/router.ex +++ b/apps/block_scout_web/lib/block_scout_web/router.ex @@ -1,6 +1,8 @@ defmodule BlockScoutWeb.Router do use BlockScoutWeb, :router + forward("/wobserver", Wobserver.Web.Router) + pipeline :browser do plug(:accepts, ["html"]) plug(:fetch_session) diff --git a/apps/block_scout_web/mix.exs b/apps/block_scout_web/mix.exs index 267f3eaddf..0ce0db8467 100644 --- a/apps/block_scout_web/mix.exs +++ b/apps/block_scout_web/mix.exs @@ -96,7 +96,8 @@ defmodule BlockScoutWeb.Mixfile do {:sobelow, ">= 0.7.0", only: [:dev, :test], runtime: false}, {:timex, "~> 3.1.24"}, {:timex_ecto, "~> 3.2.1"}, - {:wallaby, "~> 0.20", only: [:test], runtime: false} + {:wallaby, "~> 0.20", only: [:test], runtime: false}, + {:wobserver, "~> 0.1.8"} ] end diff --git a/mix.lock b/mix.lock index d5b543b148..9dbab48d03 100644 --- a/mix.lock +++ b/mix.lock @@ -79,4 +79,5 @@ "unicode_util_compat": {:hex, :unicode_util_compat, "0.3.1", "a1f612a7b512638634a603c8f401892afbf99b8ce93a45041f8aaca99cadb85e", [:rebar3], []}, "wallaby": {:hex, :wallaby, "0.20.0", "cc6663555ff7b05afbebb2a8b461d18a5b321658b9017f7bc77d494b7063266a", [:mix], [{:httpoison, "~> 0.12", [hex: :httpoison, optional: false]}, {:poison, ">= 1.4.0", [hex: :poison, optional: false]}, {:poolboy, "~> 1.5", [hex: :poolboy, optional: false]}]}, "websocket_client": {:hex, :websocket_client, "1.3.0", "2275d7daaa1cdacebf2068891c9844b15f4fdc3de3ec2602420c2fb486db59b6", [:rebar3], [], "hexpm"}, + "wobserver": {:hex, :wobserver, "0.1.8", "3ed5ea55478627f0593800ab83919b71f41fd426ec344e71cf1d975e6d2065b8", [:mix], [{:cowboy, "~> 1.1", [hex: :cowboy, repo: "hexpm", optional: false]}, {:httpoison, "~> 0.11 or ~> 0.12", [hex: :httpoison, repo: "hexpm", optional: false]}, {:plug, "~> 1.3 or ~> 1.4", [hex: :plug, repo: "hexpm", optional: false]}, {:poison, "~> 2.0 or ~> 3.1", [hex: :poison, repo: "hexpm", optional: false]}, {:websocket_client, "~> 1.2", [hex: :websocket_client, repo: "hexpm", optional: false]}], "hexpm"}, }