Почитайте про
подключение к сокетам.
Цитата:
По умолчанию Flash Player ищет файл политики сокетов у порта 843 и у того же порта, который используется для основного подключения к сокету.
|
У меня, например, было так:
Код:
import java.net.*;
import java.io.*;
class FlashSecurityServer
{
public static void main(String[] args)
{
try
{
System.out.println("-> Security server started...");
ServerSocket server = new ServerSocket(843, 128, InetAddress.getByName("192.168.34.36"));
Socket client;
DataOutputStream out;
DataInputStream in;
// Reading crossdomain.xml
FileInputStream xmlFile = new FileInputStream("files/crossdomain.xml");
int xmlBytesCount = xmlFile.available();
byte[] xmlBytes = new byte[xmlBytesCount + 1];
xmlFile.read(xmlBytes, 0, xmlBytesCount);
xmlBytes[xmlBytesCount] = 0;
xmlFile.close();
byte[] policyRequest = new byte[23];
for (;;)
{
client = server.accept();
out = new DataOutputStream(client.getOutputStream());
in = new DataInputStream(client.getInputStream());
in.read(policyRequest, 0, 23);
out.write(xmlBytes, 0, xmlBytesCount + 1);
out.flush();
System.out.println(":: FSS :: Policy sended to " + client.toString());
client.close();
}
}
catch (Exception e)
{
e.printStackTrace();
}
}
}
А crossdomain.xml был такой:
Код:
<?xml version="1.0"?>
<cross-domain-policy>
<allow-access-from domain="*" to-ports="*" meta-policy="master-only"/>
</cross-domain-policy>