Hello! I am writing an application for VKontakte. It uses server interaction via Socket. The server is on the Internet (not on the local computer). When I start the client from a local computer, everything works. And when I download VKontakte, the client does not connect to the server. Sometimes an error 2048 is issued. There is a crossdomain.xml file, as I have not already experimented with it. Here are its contents:

<?xml version="1.0"?> <cross-domain-policy> <allow-access-from domain="*" to-ports="*"/> <allow-http-request-headers-from domain="*"/> </cross-domain-policy> 

Moreover, requests for scripts work fine, but the sockets are not. Tell me, what could be wrong?

    1 answer 1

    when the connection from the AS goes through a socket , then crossdomain.xml is not enough, you need to send a socket security policy from the server. The default is through port 843 . Here, it seems there is a discussion on the topic.

    For VK, this strategy usually looks something like this:

     <cross-domain-policy> <allow-access-from domain="*.vkontakte.ru" to-ports="11111"/> <allow-access-from domain="*.vk.com" to-ports="11111"/> </cross-domain-policy> 

    It is possible that you should still allow access to the folder of the client application (if you are testing swf locally) in the security settings

    • Locally everything works. Now everything is rechecked through Putty. The server at port 843 on the request <policy-file-request /> returns the following response: <cross-domain-policy> <allow-access-domain = " " to-ports = " " /> </ cross-domain-policy > That is, the server is working correctly. Through the developer tools in Google Chrome, I track incoming information when booting a flash drive from VK. Crossdomain files from the very Vkontakt and from the second server (on which the scripts) are downloaded, but there is nothing from the socket server. I tried not to post on VKontakte, but on another server, the same thing. - Kefis