mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-06 15:37:52 +01:00
e380eee223
- added JSON encoding - fix problem where session was not closed - origin can now be decided by a custom module
11 lines
563 B
Erlang
11 lines
563 B
Erlang
-module (simple_ws_check).
|
|
-export ([is_acceptable/6]).
|
|
-include("ejabberd.hrl").
|
|
is_acceptable(["true"]=Path, Q, Origin, Protocol, IP, Headers)->
|
|
?INFO_MSG("Authorized Websocket ~p with: ~n Q = ~p~n Origin = ~p~n Protocol = ~p~n IP = ~p~n Headers = ~p~n",
|
|
[Path, Q, Origin, Protocol, IP, Headers]),
|
|
true;
|
|
is_acceptable(["false"]=Path, Q, Origin, Protocol, IP, Headers)->
|
|
?INFO_MSG("Failed Websocket ~p with: ~n Q = ~p~n Origin = ~p~n Protocol = ~p~n IP = ~p~n Headers = ~p~n",
|
|
[Path, Q, Origin, Protocol, IP, Headers]),
|
|
false. |