My umbrella app routes calls through a “master proxy” which really is a big plug that has a bunch of redirections. Sample:
defmodule MasterProxy.Plug do
alias MasterProxy.Plug.Request
def init(options) do
options
end
def call(conn, _opts) do
cond do
conn.request_path =~ ~r{/my_app} ->
MyApp.Endpoint.call(conn, [])
.....
end
end
end
One of these redirects is towards a phoenix sub-app and it works fine except for the the live socket (used for phoenix live views).
It complains that the route for /live/websocket
was not found even though my endpoint.ex contains:
socket "/live", Phoenix.LiveView.Socket
as per the doc.
Now the weird part is that if I hit the sub-app directly on it’s port (say 4008 locally) then the socket seems to connect fine.
My guess is that something goes awry when it passes through the proxy redirect, but I can’t seem to figure out what?
Any clues?