application.onConnect = function(pClient) {
var isIPOK = true;
getBannedIPList();
for (var index=0; index<this.bannedIPList.length; index++) {
var currentIP = this.bannedIPList[index];
if (pClient.ip == currentIP) {
isIPOK = false;
trace("ip was rejected");
break;
}
}
if (isIPOK) {
this.acceptConnection(pClient);
} else {
this.rejectConnection(pClient);
}
}
In addition, you can create server-side code to check if requests are coming in too quickly from a particular domain:
application.VERIFY_TIMEOUT_VALUE = 2000;
Client.prototype.verifyTimeOut = function() {
trace (">>>> Closing Connection")
clearInterval(this.$verifyTimeOut);
application.disconnect(this);
}
function VerifyClientHandler(pClient) {
this.onResult = function (pClientRet) {
// if the client returns the correct key, then clear timer
if (pClientRet.key == pClient.verifyKey.key) {
trace("Connection Passed");
clearInterval(pClient.$verifyTimeOut);
}
}
}
application.onConnect = function(pClient) {
this.acceptConnection(pClient);
// create a random key and package within an Object
pClient.verifyKey = ({key: Math.random()});
// send the key to the client
pClient.call("verifyClient",
new VerifyClientHandler(pClient),
pClient.verifyKey);
// set a wait timer
pClient.$verifyTimeOut = setInterval(pClient,
}
application.onDisconnect = function(pClient) {
clearInterval(pClient.$verifyTimeOut);
}
$verifyTimeOut,
this.VERIFY_TIMEOUT_VALUE,
pClient);
ADOBE FLASH MEDIA SERVER
Developer Guide
59
Need help?
Do you have a question about the 65029121 - Flash Media Streaming Server and is the answer not in the manual?