[ejabberd] Flash jabber client : Howto serve cross-domain policy

Badlop badlop at gmail.com
Mon Jun 9 20:53:00 MSD 2008


On Mon, Jun 9, 2008 at 2:54 PM,  <cplusou-s at yahoo.fr> wrote:
> How is it possible to modify this script to make it works with the latest
> version of ejabberd_c2s.erl file ?

Try this. I only verified it compiles.
If it really works, please report here, maybe other people is
interested in the patch.


*****************************
--- src/ejabberd_c2s.erl
+++ src/ejabberd_c2s.erl
@@ -387,6 +387,17 @@ wait_for_stream({xmlstreamend, _}, StateData) ->
     send_text(StateData, ?INVALID_XML_ERR ++ ?STREAM_TRAILER),
     {stop, normal, StateData};

+wait_for_stream({xmlstreamstart, "policy-file-request", _Attrs}, StateData) ->
+    ejabberd_socket:reset_stream(StateData#state.socket),
+    send_text(StateData,
+             "<?xml version=\"1.0\"?>\n"
+             "<!DOCTYPE cross-domain-policy SYSTEM "
+             "\"http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd\">\n"
+             "<cross-domain-policy>\n"
+             "       <allow-access-from domain=\"*\" to-ports=\"*\"/>\n"
+             "</cross-domain-policy>\n\0"),
+    {stop, normal, StateData};
+
 wait_for_stream({xmlstreamerror, _}, StateData) ->
     Header = io_lib:format(?STREAM_HEADER,
                           ["none", ?MYNAME, " version='1.0'", ""]),
**********************


More information about the ejabberd mailing list