25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-06 15:37:52 +01:00
xmpp.chapril.org-ejabberd/src/web/simple_ws_check.erl
Eric Cestari e380eee223 WebSocket support update
- added JSON encoding
- fix problem where session was not closed
- origin can now be decided by a custom module
2011-01-19 14:54:20 +01:00

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.