ETC
RSS Links
Tag Cloud
5.3 abstract actionscript actionscript3 Adapter adobe Advance ajax Anonymous Anonymous function apache Array array_walk article as as3 as3corelib Auth Base64 basics bind bitmap bug bytearray callback catch chart charts class cleanup client closures closures function CodeIgniter commerce communicate Communicator compiler console console.log controller crypto css custom event Decryption design patterns dialog dispatch div download Dwoo ecommerce editor Encode Encryption engine ereg ereg_replace error event example experiment explorer facebook Factory Factory Method file Flash Flash Media Server FMS Framework free function garry GNU GPL grchart hash link html ide ie ifconfig image insert internet explorer ip javascript jpeg jQuery jquery plugin js json lachman layer Layout Solution lib libary linux load local localhost log login manager MD5 MDB media microsoft Migrating Mime Type module modules mod_rewrite mvc mysql News Object Oriented old one time link one time url OOP Open Power Template open source oscommerce package pattern PEAR PEAR::Auth php php4 php5 php 5.3 phpclasses.org PHP Framework phpwebcommerce plugin PNG popup posfix POST preg_match preg_replace Presentation problem rect regex regexp request Requirements screen screen manager script select send server session shopping Shopping Cart singleton smarty Solution source code Specification sql ssh static STP table template templates this tooltip trigger try Tutorial UI update url User Interface users utf-8 util utils validate variables vi view vim virus warning widget window wordpress xml XTemplate yourinspirationweb
FMS blocked port detection – ActionScript 3
FMS block port detection – ActionScript 3
The fms port (1935) closed on many office firewalls, the problem
is that flash had 30 sec timeout before tunnle it to port 80.
Becouse that i write little script that use socket object to test the
port and tunnle it to http when port 1935 is closed.
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
{
import flash.events.Event;
import flash.net.Socket;
import flash.events.IOErrorEvent
import flash.events.SecurityErrorEvent
/**
* @author Garry Lachman
*
* Usage:
* FMSPortTester.TestPorts(onSuccess)
* function onSuccess(_fmsURL:String):void {
* }
*/
public class FMSPortTester
{
public static const FMS_URL:String = "127.0.0.1";
public static const PREFIX_1935:String = "rtmp://";
public static const PREFIX_80:String = "rtmpt://";
public static const SOCKET_TIMEOUT:Number = 3;
public function FMSPortTester() { trace("static only class"); }
public static function TestPorts(_resultURLCallBack:Function):void {
// Create socket connection to fms to check the ports
var socketTest:Socket = new Socket();
socketTest.connect(FMS_URL, 1935);
socketTest.addEventListener(Event.CONNECT, onSocketConnected);
socketTest.addEventListener(IOErrorEvent.IO_ERROR, onSocketError);
socketTest.addEventListener(SecurityErrorEvent.SECURITY_ERROR,onSocketError);
socketTest.timeout = (SOCKET_TIMEOUT * 1000);
// is connected, fms ports ok
function onSocketConnected(_e:Event):void {
_resultURLCallBack(PREFIX_1935 + "" + FMS_URL);
}
// on error, fms ports closed
function onSocketError(_e:*):void {
_resultURLCallBack(PREFIX_80 + "" + FMS_URL);
}
}
}
}