I can not figure out how to make phoenix sockets longpool work. My config is like this:
in endpoint.ex:
socket("/socket", Carts.ApiWeb.CartSocket, websocket: true, longpoll: true)
in cart_socket.ex:
channel("cart:*", Carts.ApiWeb.CartChannel)
in config:
config :carts_api, Carts.ApiWeb.Endpoint,
http: [port: "${CARTS_PORT}", protocol_options: [max_keepalive: 200]],
url: [host: "${CARTS_URL}", port: 443, scheme: "https"],
secret_key_base: "${SECRET_KEY_BASE}",
check_origin: false
And I keep being bombarded with this error on server side side:
Elixir.ErlangError · Erlang error: {{%Phoenix.Router.NoRouteError{conn: %Plug.Conn{adapter: {Plug.Cowboy.Conn, :âŠ}, assigns: %{}, before_send: [#Function<0.44602488/1 in Carts.ApiWeb.PipelineInstrumenter.call/2>, #Function<1.112466771/1 in Plug.Logger.call/2>], body_params: %{}, cookies: %Plug.Conn.Unfetched{aspect: :cookies}, halted: false, host: â.zuppler.com", method: âGETâ, owner: #PID<0.6594.29>, params: %{âvsnâ => â2.0.0â}, path_info: [âsocketâ, âlongpollâ], path_params: %{}, port: 80, private: %{Carts.ApiWeb.Router => {[], %{Zuppler.Phoenix.Utils.PingPongPlugRouter => [âpingâ]}}, :phoenix_endpoint => Carts.ApiWeb.Endpoint, :phoenix_router => Carts.ApiWeb.Router, :plug_session_fetch => #Function<1.64872641/1 in Plug.Session.fetch_session/1>}, query_params: %{âvsnâ => â2.0.0â}, query_string: âvsn=2.0.0&â, remote_ip: {192, 168, 126, 248}, req_cookies: %Plug.Conn.Unfetched{aspect: :cookies}, req_headers: [{âacceptâ, "/"}, {âaccept-encodingâ, âgzip, deflate, peerdistâ}, {âaccept-languageâ, âen-USâ}, {âcache-controlâ, âno-cacheâ}, {âcontent-typeâ, âapplication/jsonâ}, {âdntâ, â1â}, {âhostâ, ".zuppler.com"}, {âoriginâ, âhttps://www.cuginisyracuse.comâ}, {ârefererâ, âhttps://www.cuginisyracuse.com/â}, {âua-cpuâ, âAMD64â}, {âuser-agentâ, âMozilla/5.0 (Windows NT 6.1; Win64; x64; Trident/7.0; rv:11.0) like Geckoâ}, {âx-forwarded-forâ, â65.196.116.115â}, {âx-forwarded-hostâ, ".zuppler.com"}, {âx-forwarded-portâ, â443â}, {âx-forwarded-protoâ, âhttpsâ}, {âx-original-uriâ, â/socket/longpoll?vsn=2.0.0&â}, {âx-p2p-peerdistâ, âVersion=1.0â}, {âx-real-ipâ, â65.196.116.115â}, {âx-request-idâ, â2c83b337fe13a6b236963044ebe5a213â}, {âx-schemeâ, âhttpsâ}], request_path: â/socket/longpollâ, resp_body: nil, resp_cookies: %{}, resp_headers: [{âcache-controlâ, âmax-age=0, private, must-revalidateâ}, {âx-request-idâ, â2c83b337fe13a6b236963044ebe5a213â}, {âvaryâ, âOriginâ}, {âaccess-control-allow-originâ, âhttps://www.cuginisyracuse.comâ}, {âaccess-control-expose-headersâ, ââ}, {âaccess-control-allow-credentialsâ, âtrueâ}], scheme: :http, script_name: [], secret_key_base: :âŠ, state: :unset, status: nil}, message: âno route found for GET /socket/longpoll (Carts.ApiWeb.Router)â, plug_status: 404, router: Carts.ApiWeb.Router}, [{Carts.ApiWeb.Router, :âcall (overridable 2)â, 2, [file: âlib/phoenix/router.exâ, line: 324]}, {Carts.ApiWeb.Router, :call, 2, [file: âlib/plug/error_handler.exâ, line: 64]}, {Carts.ApiWeb.Endpoint, :plug_builder_call, 2, [file: âlib/carts-api-web/endpoint.exâ, line: 1]}, {Carts.ApiWeb.Endpoint, :call, 2, [file: âlib/carts-api-web/endpoint.exâ, line: 1]}, {Plug.Cowboy.Handler, :init, 2, [file: âlib/plug/cowboy/handler.exâ, line: 12]}, {:cowboy_handler, :execute, 2, [file: â/tmp/build/deps/cowboy/src/cowboy_handler.erlâ, line: 41]}, {:cowboy_stream_h, :execute, 3, [file: â/tmp/build/deps/cowboy/src/cowboy_stream_h.erlâ, line: 296]}, {:cowboy_stream_h, :request_process, 3, [file: â/tmp/build/deps/cowboy/src/cowboy_stream_h.erlâ, line: 274]}]}, {MasterProxy.Plug, :call, [%Plug.Conn{adapter: {Plug.Cowboy.Conn, :âŠ}, assigns: %{}, before_send: [], body_params: %Plug.Conn.Unfetched{aspect: :body_params}, cookies: %Plug.Conn.Unfetched{aspect: :cookies}, halted: false, host: ".zuppler.com", method: âGETâ, owner: #PID<0.6594.29>, params: %Plug.Conn.Unfetched{aspect: :params}, path_info: [âsocketâ, âlongpollâ], path_params: %{}, port: 80, private: %{}, query_params: %Plug.Conn.Unfetched{aspect: :query_params}, query_string: âvsn=2.0.0&â, remote_ip: {192, 168, 126, 248}, req_cookies: %Plug.Conn.Unfetched{aspect: :cookies}, req_headers: [{âacceptâ, "/â}, {âaccept-encodingâ, âgzip, deflate, peerdistâ}, {âaccept-languageâ, âen-USâ}, {âcache-controlâ, âno-cacheâ}, {âcontent-typeâ, âapplication/jsonâ}, {âdntâ, â1â}, {âhostâ, â*.zuppler.com"}, {âoriginâ, âhttps://www.cuginisyracuse.comâ}, {ârefererâ, âhttps://www.cuginisyracuse.com/â}, {âua-cpuâ, âAMD64â}, {âuser-agentâ, âMozilla/5.0 (Windows NT 6.1; Win64; x64; Trident/7.0; rv:11.0) like Geckoâ}, {âx-forwarded-forâ, â65.196.116.115â}, {âx-forwarded-hostâ, ".zuppler.comâ}, {âx-forwarded-portâ, â443â}, {âx-forwarded-protoâ, âhttpsâ}, {âx-original-uriâ, â/socket/longpoll?vsn=2.0.0&â}, {âx-p2p-peerdistâ, âVersion=1.0â}, {âx-real-ipâ, â65.196.116.115â}, {âx-request-idâ, â2c83b337fe13a6b236963044ebe5a213â}, {âx-schemeâ, âhttpsâ}], request_path: â/socket/longpollâ, resp_body: nil, resp_cookies: %{}, resp_headers: [{âcache-controlâ, âmax-age=0, private, must-revalidateâ}], scheme: :http, script_name: , secret_key_base: nil, state: :unset, status: nil}, ]}}
I have no idea how to fix this