mirror of
https://git.pleroma.social/pleroma/pleroma.git
synced 2024-12-23 08:36:29 +00:00
Add handler for Phoenix-style socket.
This commit is contained in:
parent
b9ac7067eb
commit
8910e103ce
1 changed files with 13 additions and 0 deletions
|
@ -54,6 +54,17 @@ config :pleroma, :uri_schemes,
|
||||||
"xmpp"
|
"xmpp"
|
||||||
]
|
]
|
||||||
|
|
||||||
|
websocket_config = [
|
||||||
|
path: "/websocket",
|
||||||
|
serializer: [
|
||||||
|
{Phoenix.Socket.V1.JSONSerializer, "~> 1.0.0"},
|
||||||
|
{Phoenix.Socket.V2.JSONSerializer, "~> 2.0.0"}
|
||||||
|
],
|
||||||
|
timeout: 60_000,
|
||||||
|
transport_log: false,
|
||||||
|
compress: false
|
||||||
|
]
|
||||||
|
|
||||||
# Configures the endpoint
|
# Configures the endpoint
|
||||||
config :pleroma, Pleroma.Web.Endpoint,
|
config :pleroma, Pleroma.Web.Endpoint,
|
||||||
url: [host: "localhost"],
|
url: [host: "localhost"],
|
||||||
|
@ -62,6 +73,8 @@ config :pleroma, Pleroma.Web.Endpoint,
|
||||||
{:_,
|
{:_,
|
||||||
[
|
[
|
||||||
{"/api/v1/streaming", Elixir.Pleroma.Web.MastodonAPI.WebsocketHandler, []},
|
{"/api/v1/streaming", Elixir.Pleroma.Web.MastodonAPI.WebsocketHandler, []},
|
||||||
|
{"/socket/websocket", Phoenix.Endpoint.CowboyWebSocket,
|
||||||
|
{nil, {Pleroma.Web.Endpoint, Pleroma.Web.UserSocket, websocket_config}}},
|
||||||
{:_, Plug.Adapters.Cowboy.Handler, {Pleroma.Web.Endpoint, []}}
|
{:_, Plug.Adapters.Cowboy.Handler, {Pleroma.Web.Endpoint, []}}
|
||||||
]}
|
]}
|
||||||
]
|
]
|
||||||
|
|
Loading…
Reference in a new issue