我尝试使用 SecureSocket 但 SecureSocket.isSupported == false。当我使用简单的 Socket 时,一切正常。
有人使用 SecureSocket 吗?
这是我的代码: Security.allowDomain(' '); Security.allowInsecureDomain(" "); Security.loadPolicyFile("xmlsocket://" + 主机 + ':' + 端口 + "/crossdomain.xml");
if(SecureSocket.isSupported)
{
c = new SecureSocket();
receiveBuffer = new ByteArray();
receiveBuffer.endian = Endian.LITTLE_ENDIAN;
c.addEventListener(Event.CLOSE, closeHandler);
c.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
c.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
c.addEventListener(Event.CONNECT, connectHandler);
}
else
{
try
{
c = new SecureSocket();
}
catch(e:Error)
{
trace(e.toString());
}
}
后来我有错误:[SWF] /assets/flash/ssl/Main.swf - 63,146 bytes after decompression Error: Request for resource at tlssocket://game9.lgr.su:8081 by requestor from https://game9.lgr .su/assets/flash/ssl/Main.swf失败,因为无法访问服务器。
* 违反安全沙盒 *与 game9.lgr.su:8081 的连接停止 - https://game9.lgr.su/assets/flash/ssl/Main.swf 不允许