Hello,
I'm not sure if this is hte right place to ask for assistance, but I'll try anyway.
With the new version of flash out 9.0.124.0 some changes have been made where Flash is no longer permitted to receive policy permissions from a crossdomain.xml on a webserver.
The only method in which Flash can receive crossdomain permission is directly through an xmlsocket connection.
With another XMPP server, OpenFire, a patch has been created where the policy file can be served via xmlsocket://domain.com:port
My question is, how do you setup an EJabberd server to do this as well?
From flash i need to request the crossdomain policy file via xmlsocket://jabberserver.net:5222 or even preferrably port 80, and receive it through the socket.
Unfortunately this is the only method in which to accept external Flash connections with the new flash.
any help or redirection to where i can get help would be greatly appreciated.
thanks in advance,
-
G
For reference, the author
For reference, the author posted thesame question in the XIFF forum and finally solved the problem, but didn't publish the solution.
Flash to Ejabberd XML Socket serving policy file
I "solved" the problem to which the author refers, for the author.
For the record, I just put a small perl script in background on the same machine that's running the ejabberd server that responds with a cross domain socket policy to properly formatted requests coming in over port 843.
That doesn't really solve the author's problem, just allows him to continue with his testing pending a better resolution.
Ignite's openfire programming addresses the requirement quite handily. They went through a few iterations and finally went down to stanza parsing level and and added code that if <policy-file-request/> followed by a NULL byte is the entirety of the stanza, the content of an identified flash socket policy file is served up (enhanced crossdomain.xml, for example).
This is a great implementation since the same port is used for xmpp and socket policy service.
There are a number of points in the ejabberd code where this could be inserted with a minimum impact, but, would probably be addressed better in a module.
Anyone have any ideas?
You can find solution
for this (for ejabberd, including latest version, 2.0.1_2) here -
http://www.ejabberd.im/node/2833#comment-53343
I personnaly think this is
I personnaly think this is quite ugly hack.
Using different port for different usage is clean, but imagine the code for a system serving on the same port: XMPP, HTTP, FTP, IMAP, SMTP, etc. This feel really hackish...
--
Process-one
Mickaël Rémond
Flash to Ejabberd XML Socket serving policy file - hack
I agree with Mickael R. that this is a hack, however, just like the Flash non-convention of NULL terminator for internet apps, Flash has introduced another problem for developers.
Given that a large number of sites do not allow ports other than 80, 443, 20, 21, etc. developers are severely limited in creating innovative applications across the WWWeb.
I recognize that this may be a "slippery slope", but, that is another conversation.
Openfire addressed the reality of current requirements. If someone can address the same with a module vs. modification to the core, that would be great.
You can check this patch
You can check this patch recently updated:Serve cross domain policy file for Flash
Excellent patch!
Yeah, it makes me stop using previous patch from monsieur Badlop (adopted by myself)... and have to recompile ejabberd again :).
But... Can I make a humble suggestion?
Maybe, it will be better and more useful, to combine to patches (flash-hack and flash-policy) in one patch ?
And... even a more humble proposal :) Maybe it worth to include these patches in main branch, adopt for new versions, etc ?
If somebody likes, let them just configure ejabberd with --enable-flash-hack, if they want? Or even a simple option in ejabberd.cfg ?
The reason of my advocacy... is - it will be, first of all, just additional competitive advantage (I know, You understand, what I mean...)
Also, as I know, the situation is following - not all flash-developers correctly understands and can use ActiveScript3 (Flash 9), also, maybe some people want their flash-clients can be run also in Flash 8 computers....
Excellent Patch
The patch is available now for 2.0.1.
Badlop had sent me a version of the patch for a newer release (which I couldn't use). I don't know if will be included in newer release as a patch or in the main branch.
This patch should also work for Flash 8.
To use the patch, I only had to recompile ejabberd_c2s.beam and not ejabberd. After compile of patched ejabberd_c2s.hrl, copied new ejabberd_c2s.beam to
ejabberd-2.0.1\lib\ejabberd-2.0.1\ebin directory (Windows version).
Naturally, if you are not using change control software, make back-up copies of any files that will change.