summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHiroshi Ichikawa <gimite@gmail.com>2011-02-27 11:46:51 +0900
committerHiroshi Ichikawa <gimite@gmail.com>2011-02-27 11:46:51 +0900
commit87daea0c26c030800043e1068e17cc9bc0fa004c (patch)
tree1016fab5eb476a84a3a560a306c4cc4c50a48730
parent59443d254fa9ad8743416e02dfba4a0ac75aa482 (diff)
parent97921866913b472b40428a6f327a3e3b5616c159 (diff)
downloadweb-socket-js-87daea0c26c030800043e1068e17cc9bc0fa004c.tar.gz
Merging.
-rw-r--r--WebSocket.swcbin0 -> 246314 bytes
-rw-r--r--WebSocketMain.swfbin175591 -> 175680 bytes
-rw-r--r--flash-src/IWebSocketWrapper.as9
-rw-r--r--flash-src/WebSocket.as4
-rw-r--r--flash-src/WebSocketMain.as2
-rwxr-xr-xflash-src/build.sh7
6 files changed, 17 insertions, 5 deletions
diff --git a/WebSocket.swc b/WebSocket.swc
new file mode 100644
index 0000000..92ff58f
--- /dev/null
+++ b/WebSocket.swc
Binary files differ
diff --git a/WebSocketMain.swf b/WebSocketMain.swf
index 8bfada1..74a70a1 100644
--- a/WebSocketMain.swf
+++ b/WebSocketMain.swf
Binary files differ
diff --git a/flash-src/IWebSocketWrapper.as b/flash-src/IWebSocketWrapper.as
new file mode 100644
index 0000000..0dd87d0
--- /dev/null
+++ b/flash-src/IWebSocketWrapper.as
@@ -0,0 +1,9 @@
+package {
+
+ public interface IWebSocketWrapper {
+ function getOrigin():String;
+ function getCallerHost():String;
+ function log(message:String):void;
+ function error(message:String):void;
+ }
+} \ No newline at end of file
diff --git a/flash-src/WebSocket.as b/flash-src/WebSocket.as
index 63fac7d..72cc7d1 100644
--- a/flash-src/WebSocket.as
+++ b/flash-src/WebSocket.as
@@ -36,7 +36,7 @@ public class WebSocket extends EventDispatcher {
private var tlsSocket:TLSSocket;
private var tlsConfig:TLSConfig;
private var socket:Socket;
- private var main:WebSocketMain;
+ private var main:IWebSocketWrapper;
private var url:String;
private var scheme:String;
private var host:String;
@@ -52,7 +52,7 @@ public class WebSocket extends EventDispatcher {
private var expectedDigest:String;
public function WebSocket(
- main:WebSocketMain, id:int, url:String, protocol:String,
+ main:IWebSocketWrapper, id:int, url:String, protocol:String,
proxyHost:String = null, proxyPort:int = 0,
headers:String = null) {
this.main = main;
diff --git a/flash-src/WebSocketMain.as b/flash-src/WebSocketMain.as
index 05b3aab..22d42f5 100644
--- a/flash-src/WebSocketMain.as
+++ b/flash-src/WebSocketMain.as
@@ -15,7 +15,7 @@ import mx.utils.URLUtil;
/**
* Provides JavaScript API of WebSocket.
*/
-public class WebSocketMain extends Sprite {
+public class WebSocketMain extends Sprite implements IWebSocketWrapper{
private var callerUrl:String;
private var debug:Boolean = false;
diff --git a/flash-src/build.sh b/flash-src/build.sh
index 32fa6b3..3a37cf2 100755
--- a/flash-src/build.sh
+++ b/flash-src/build.sh
@@ -5,6 +5,9 @@
mxmlc -static-link-runtime-shared-libraries -target-player=10.0.0 -output=../WebSocketMain.swf WebSocketMain.as &&
mxmlc -static-link-runtime-shared-libraries -output=../WebSocketMainInsecure.swf WebSocketMainInsecure.as &&
+compc -source-path . -include-classes WebSocket IWebSocketWrapper -output=../WebSocket.swc &&
cd .. &&
-zip WebSocketMainInsecure.zip WebSocketMainInsecure.swf &&
-rm WebSocketMainInsecure.swf
+zip WebSocketMainInsecure.zip WebSocketMainInsecure.swf WebSocket.swc &&
+rm WebSocketMainInsecure.swf
+
+