Permalink
Browse files

Merge branch 'master' into hybi-07

Conflicts:
	WebSocketMain.swf
	WebSocketMainInsecure.zip
  • Loading branch information...
2 parents 4be643b + 5c7df9d commit a308f867c7874844fa6547360fe96d5b97fa1deb @gimite committed Sep 17, 2011
Showing with 73 additions and 18 deletions.
  1. BIN WebSocketMain.swf
  2. BIN WebSocketMainInsecure.zip
  3. +16 −3 flash-src/build.sh
  4. +45 −13 flash-src/build.xml
  5. 0 flash-src/{ → src}/net/gimite/websocket/IWebSocketLogger.as
  6. 0 flash-src/{ → src}/net/gimite/websocket/WebSocket.as
  7. 0 flash-src/{ → src}/net/gimite/websocket/WebSocketEvent.as
  8. 0 flash-src/{ → src}/net/gimite/websocket/WebSocketMain.as
  9. +3 −0 flash-src/{ → src}/net/gimite/websocket/WebSocketMainInsecure.as
  10. 0 flash-src/{ → third-party}/com/adobe/net/proxies/RFC2817Socket.as
  11. 0 flash-src/{ → third-party}/com/gsolo/encryption/MD5.as
  12. 0 flash-src/{ → third-party}/com/gsolo/encryption/SHA1.as
  13. 0 flash-src/{ → third-party}/com/hurlant/crypto/Crypto.as
  14. 0 flash-src/{ → third-party}/com/hurlant/crypto/cert/MozillaRootCertificates.as
  15. 0 flash-src/{ → third-party}/com/hurlant/crypto/cert/X509Certificate.as
  16. 0 flash-src/{ → third-party}/com/hurlant/crypto/cert/X509CertificateCollection.as
  17. 0 flash-src/{ → third-party}/com/hurlant/crypto/hash/HMAC.as
  18. 0 flash-src/{ → third-party}/com/hurlant/crypto/hash/IHMAC.as
  19. 0 flash-src/{ → third-party}/com/hurlant/crypto/hash/IHash.as
  20. 0 flash-src/{ → third-party}/com/hurlant/crypto/hash/MAC.as
  21. 0 flash-src/{ → third-party}/com/hurlant/crypto/hash/MD2.as
  22. 0 flash-src/{ → third-party}/com/hurlant/crypto/hash/MD5.as
  23. 0 flash-src/{ → third-party}/com/hurlant/crypto/hash/SHA1.as
  24. 0 flash-src/{ → third-party}/com/hurlant/crypto/hash/SHA224.as
  25. 0 flash-src/{ → third-party}/com/hurlant/crypto/hash/SHA256.as
  26. 0 flash-src/{ → third-party}/com/hurlant/crypto/hash/SHABase.as
  27. 0 flash-src/{ → third-party}/com/hurlant/crypto/prng/ARC4.as
  28. 0 flash-src/{ → third-party}/com/hurlant/crypto/prng/IPRNG.as
  29. 0 flash-src/{ → third-party}/com/hurlant/crypto/prng/Random.as
  30. 0 flash-src/{ → third-party}/com/hurlant/crypto/prng/TLSPRF.as
  31. 0 flash-src/{ → third-party}/com/hurlant/crypto/rsa/RSAKey.as
  32. 0 flash-src/{ → third-party}/com/hurlant/crypto/symmetric/AESKey.as
  33. 0 flash-src/{ → third-party}/com/hurlant/crypto/symmetric/BlowFishKey.as
  34. 0 flash-src/{ → third-party}/com/hurlant/crypto/symmetric/CBCMode.as
  35. 0 flash-src/{ → third-party}/com/hurlant/crypto/symmetric/CFB8Mode.as
  36. 0 flash-src/{ → third-party}/com/hurlant/crypto/symmetric/CFBMode.as
  37. 0 flash-src/{ → third-party}/com/hurlant/crypto/symmetric/CTRMode.as
  38. 0 flash-src/{ → third-party}/com/hurlant/crypto/symmetric/DESKey.as
  39. 0 flash-src/{ → third-party}/com/hurlant/crypto/symmetric/ECBMode.as
  40. 0 flash-src/{ → third-party}/com/hurlant/crypto/symmetric/ICipher.as
  41. 0 flash-src/{ → third-party}/com/hurlant/crypto/symmetric/IMode.as
  42. 0 flash-src/{ → third-party}/com/hurlant/crypto/symmetric/IPad.as
  43. 0 flash-src/{ → third-party}/com/hurlant/crypto/symmetric/IStreamCipher.as
  44. 0 flash-src/{ → third-party}/com/hurlant/crypto/symmetric/ISymmetricKey.as
  45. 0 flash-src/{ → third-party}/com/hurlant/crypto/symmetric/IVMode.as
  46. 0 flash-src/{ → third-party}/com/hurlant/crypto/symmetric/NullPad.as
  47. 0 flash-src/{ → third-party}/com/hurlant/crypto/symmetric/OFBMode.as
  48. 0 flash-src/{ → third-party}/com/hurlant/crypto/symmetric/PKCS5.as
  49. 0 flash-src/{ → third-party}/com/hurlant/crypto/symmetric/SSLPad.as
  50. 0 flash-src/{ → third-party}/com/hurlant/crypto/symmetric/SimpleIVMode.as
  51. 0 flash-src/{ → third-party}/com/hurlant/crypto/symmetric/TLSPad.as
  52. 0 flash-src/{ → third-party}/com/hurlant/crypto/symmetric/TripleDESKey.as
  53. 0 flash-src/{ → third-party}/com/hurlant/crypto/symmetric/XTeaKey.as
  54. 0 flash-src/{ → third-party}/com/hurlant/crypto/symmetric/aeskey.pl
  55. 0 flash-src/{ → third-party}/com/hurlant/crypto/symmetric/dump.txt
  56. 0 flash-src/{ → third-party}/com/hurlant/crypto/tests/AESKeyTest.as
  57. 0 flash-src/{ → third-party}/com/hurlant/crypto/tests/ARC4Test.as
  58. 0 flash-src/{ → third-party}/com/hurlant/crypto/tests/BigIntegerTest.as
  59. 0 flash-src/{ → third-party}/com/hurlant/crypto/tests/BlowFishKeyTest.as
  60. 0 flash-src/{ → third-party}/com/hurlant/crypto/tests/CBCModeTest.as
  61. 0 flash-src/{ → third-party}/com/hurlant/crypto/tests/CFB8ModeTest.as
  62. 0 flash-src/{ → third-party}/com/hurlant/crypto/tests/CFBModeTest.as
  63. 0 flash-src/{ → third-party}/com/hurlant/crypto/tests/CTRModeTest.as
  64. 0 flash-src/{ → third-party}/com/hurlant/crypto/tests/DESKeyTest.as
  65. 0 flash-src/{ → third-party}/com/hurlant/crypto/tests/ECBModeTest.as
  66. 0 flash-src/{ → third-party}/com/hurlant/crypto/tests/HMACTest.as
  67. 0 flash-src/{ → third-party}/com/hurlant/crypto/tests/ITestHarness.as
  68. 0 flash-src/{ → third-party}/com/hurlant/crypto/tests/MD2Test.as
  69. 0 flash-src/{ → third-party}/com/hurlant/crypto/tests/MD5Test.as
  70. 0 flash-src/{ → third-party}/com/hurlant/crypto/tests/OFBModeTest.as
  71. 0 flash-src/{ → third-party}/com/hurlant/crypto/tests/RSAKeyTest.as
  72. 0 flash-src/{ → third-party}/com/hurlant/crypto/tests/SHA1Test.as
  73. 0 flash-src/{ → third-party}/com/hurlant/crypto/tests/SHA224Test.as
  74. 0 flash-src/{ → third-party}/com/hurlant/crypto/tests/SHA256Test.as
  75. 0 flash-src/{ → third-party}/com/hurlant/crypto/tests/TLSPRFTest.as
  76. 0 flash-src/{ → third-party}/com/hurlant/crypto/tests/TestCase.as
  77. 0 flash-src/{ → third-party}/com/hurlant/crypto/tests/TripleDESKeyTest.as
  78. 0 flash-src/{ → third-party}/com/hurlant/crypto/tests/XTeaKeyTest.as
  79. 0 flash-src/{ → third-party}/com/hurlant/crypto/tls/BulkCiphers.as
  80. 0 flash-src/{ → third-party}/com/hurlant/crypto/tls/CipherSuites.as
  81. 0 flash-src/{ → third-party}/com/hurlant/crypto/tls/IConnectionState.as
  82. 0 flash-src/{ → third-party}/com/hurlant/crypto/tls/ISecurityParameters.as
  83. 0 flash-src/{ → third-party}/com/hurlant/crypto/tls/KeyExchanges.as
  84. 0 flash-src/{ → third-party}/com/hurlant/crypto/tls/MACs.as
  85. 0 flash-src/{ → third-party}/com/hurlant/crypto/tls/SSLConnectionState.as
  86. 0 flash-src/{ → third-party}/com/hurlant/crypto/tls/SSLEvent.as
  87. 0 flash-src/{ → third-party}/com/hurlant/crypto/tls/SSLSecurityParameters.as
  88. 0 flash-src/{ → third-party}/com/hurlant/crypto/tls/TLSConfig.as
  89. 0 flash-src/{ → third-party}/com/hurlant/crypto/tls/TLSConnectionState.as
  90. 0 flash-src/{ → third-party}/com/hurlant/crypto/tls/TLSEngine.as
  91. 0 flash-src/{ → third-party}/com/hurlant/crypto/tls/TLSError.as
  92. 0 flash-src/{ → third-party}/com/hurlant/crypto/tls/TLSEvent.as
  93. 0 flash-src/{ → third-party}/com/hurlant/crypto/tls/TLSSecurityParameters.as
  94. 0 flash-src/{ → third-party}/com/hurlant/crypto/tls/TLSSocket.as
  95. 0 flash-src/{ → third-party}/com/hurlant/crypto/tls/TLSSocketEvent.as
  96. 0 flash-src/{ → third-party}/com/hurlant/crypto/tls/TLSTest.as
  97. 0 flash-src/{ → third-party}/com/hurlant/math/BarrettReduction.as
  98. 0 flash-src/{ → third-party}/com/hurlant/math/BigInteger.as
  99. 0 flash-src/{ → third-party}/com/hurlant/math/ClassicReduction.as
  100. 0 flash-src/{ → third-party}/com/hurlant/math/IReduction.as
  101. 0 flash-src/{ → third-party}/com/hurlant/math/MontgomeryReduction.as
  102. 0 flash-src/{ → third-party}/com/hurlant/math/NullReduction.as
  103. 0 flash-src/{ → third-party}/com/hurlant/math/bi_internal.as
  104. 0 flash-src/{ → third-party}/com/hurlant/util/ArrayUtil.as
  105. 0 flash-src/{ → third-party}/com/hurlant/util/Base64.as
  106. 0 flash-src/{ → third-party}/com/hurlant/util/Hex.as
  107. 0 flash-src/{ → third-party}/com/hurlant/util/Memory.as
  108. 0 flash-src/{ → third-party}/com/hurlant/util/der/ByteString.as
  109. 0 flash-src/{ → third-party}/com/hurlant/util/der/DER.as
  110. 0 flash-src/{ → third-party}/com/hurlant/util/der/IAsn1Type.as
  111. 0 flash-src/{ → third-party}/com/hurlant/util/der/Integer.as
  112. 0 flash-src/{ → third-party}/com/hurlant/util/der/OID.as
  113. 0 flash-src/{ → third-party}/com/hurlant/util/der/ObjectIdentifier.as
  114. 0 flash-src/{ → third-party}/com/hurlant/util/der/PEM.as
  115. 0 flash-src/{ → third-party}/com/hurlant/util/der/PrintableString.as
  116. 0 flash-src/{ → third-party}/com/hurlant/util/der/Sequence.as
  117. 0 flash-src/{ → third-party}/com/hurlant/util/der/Set.as
  118. 0 flash-src/{ → third-party}/com/hurlant/util/der/Type.as
  119. 0 flash-src/{ → third-party}/com/hurlant/util/der/UTCTime.as
  120. +9 −2 web_socket.js
View
Binary file not shown.
View
Binary file not shown.
View
@@ -5,8 +5,21 @@
# You need Flex 4 SDK:
# http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+4
-mxmlc -static-link-runtime-shared-libraries -target-player=10.0.0 -output=../WebSocketMain.swf -source-path=. net/gimite/websocket/WebSocketMain.as &&
-mxmlc -static-link-runtime-shared-libraries -output=../WebSocketMainInsecure.swf -source-path=. net/gimite/websocket/WebSocketMainInsecure.as &&
+mxmlc \
+ -static-link-runtime-shared-libraries \
+ -target-player=10.0.0 \
+ -output=../WebSocketMain.swf \
+ -source-path=src -source-path=third-party \
+ src/net/gimite/websocket/WebSocketMain.as &&
+
+mxmlc \
+ -static-link-runtime-shared-libraries \
+ -target-player=10.0.0 \
+ -output=../WebSocketMainInsecure.swf \
+ -source-path=src -source-path=third-party \
+ src/net/gimite/websocket/WebSocketMainInsecure.as &&
+
cd .. &&
+
zip WebSocketMainInsecure.zip WebSocketMainInsecure.swf &&
-rm WebSocketMainInsecure.swf
+rm WebSocketMainInsecure.swf
View
@@ -1,23 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
- Ant build file which provides Yet another way (other than build.sh) to build SWF files.
+ Ant build file which provides yet another way (other than build.sh) to build SWF files.
You need to copy build.properties.sample to build.properties and change FLEX_HOME
for your environment.
-->
<project name="ant" basedir="." default="swf">
-<property file="build.properties" /><!-- set sdk -->
-<echo message="Using SDK version: ${FLEX_HOME}" />
+<property file="build.properties"/><!-- set sdk -->
+<echo message="Using SDK version: ${FLEX_HOME}"/>
<!-- do not change next 2 lines, it adds needed task to ant -->
<property name="FLEXTASKS" value="${FLEX_HOME}/ant/lib/flexTasks.jar"/>
<taskdef resource="flexTasks.tasks" classpath="${FLEXTASKS}"/>
<target name="swf">
- <delete file="../WebSocketMain.swf"/>
- <mxmlc file="net/gimite/websocket/WebSocketMain.as"
+ <mxmlc file="src/net/gimite/websocket/WebSocketMain.as"
output="../WebSocketMain.swf"
incremental="false"
strict="true"
@@ -27,13 +26,13 @@
<optimize>true</optimize>
<target-player>10</target-player>
<raw-metadata></raw-metadata>
- <source-path path-element="."/>
+ <source-path path-element="src"/>
+ <source-path path-element="third-party"/>
</mxmlc>
</target>
<target name="swfInsecure">
- <delete file="../WebSocketMainInsecure.swf" />
- <mxmlc file="net/gimite/websocket/WebSocketMainInsecure.as"
+ <mxmlc file="src/net/gimite/websocket/WebSocketMainInsecure.as"
output="../WebSocketMainInsecure.swf"
incremental="false"
strict="true"
@@ -43,12 +42,13 @@
<optimize>true</optimize>
<target-player>10</target-player>
<raw-metadata></raw-metadata>
- <source-path path-element="."/>
+ <source-path path-element="src"/>
+ <source-path path-element="third-party"/>
</mxmlc>
</target>
-<target name="swc" ><!-- for pure .as -->
- <delete file="../WebSocket.swc" />
+<!-- for pure .as -->
+<target name="swc" depends="swcWithoutDependencies,dependencies">
<compc output="../WebSocket.swc"
incremental="false"
strict="true"
@@ -57,8 +57,40 @@
static-link-runtime-shared-libraries="false">
<optimize>true</optimize>
<raw-metadata></raw-metadata>
- <include-sources dir="." includes="**/*.as"/>
- <source-path path-element="."/>
+ <include-libraries dir=".." append="true" >
+ <include name="WebSocketWithoutDependencies.swc"/>
+ <include name="WebSocketDependencies.swc"/>
+ </include-libraries>
+ </compc>
+</target>
+
+<!-- for pure .as where you want to link your own version of third-party libraries -->
+<target name="swcWithoutDependencies" depends="dependencies">
+ <compc output="../WebSocketWithoutDependencies.swc"
+ incremental="false"
+ strict="true"
+ accessible="false"
+ fork="true"
+ static-link-runtime-shared-libraries="false">
+ <optimize>true</optimize>
+ <raw-metadata></raw-metadata>
+ <source-path path-element="src"/>
+ <include-sources dir="." includes="**/*.as"/>
+ <external-library-path file="../WebSocketDependencies.swc" append="true"/>
+ </compc>
+</target>
+
+<target name="dependencies">
+ <compc output="../WebSocketDependencies.swc"
+ incremental="false"
+ strict="true"
+ accessible="false"
+ fork="true"
+ static-link-runtime-shared-libraries="false">
+ <optimize>true</optimize>
+ <raw-metadata></raw-metadata>
+ <source-path path-element="third-party"/>
+ <include-sources dir="." includes="**/*.as"/>
</compc>
</target>
@@ -11,6 +11,9 @@ public class WebSocketMainInsecure extends WebSocketMain {
public function WebSocketMainInsecure() {
Security.allowDomain("*");
+ // Also allows HTTP -> HTTPS call. Since we have already allowed arbitrary domains, allowing
+ // HTTP -> HTTPS would not be more dangerous.
+ Security.allowInsecureDomain("*");
super();
}
View
@@ -51,8 +51,9 @@
}
// Uses setTimeout() to make sure __createFlash() runs after the caller sets ws.onopen etc.
// Otherwise, when onopen fires immediately, onopen is called before it is set.
- setTimeout(function() {
+ self.__createTask = setTimeout(function() {
WebSocket.__addTask(function() {
+ self.__createTask = null;
WebSocket.__flash.create(
self.__id, url, protocols, proxyHost || null, proxyPort || 0, headers || null);
});
@@ -89,6 +90,12 @@
* Close this web socket gracefully.
*/
WebSocket.prototype.close = function() {
+ if (this.__createTask) {
+ clearTimeout(this.__createTask);
+ this.__createTask = null;
+ this.readyState = WebSocket.CLOSED;
+ return;
+ }
if (this.readyState == WebSocket.CLOSED || this.readyState == WebSocket.CLOSING) {
return;
}
@@ -142,7 +149,7 @@
events[i](event);
}
var handler = this["on" + event.type];
- if (handler) handler(event);
+ if (handler) handler.apply(this, [event]);
};
/**

0 comments on commit a308f86

Please sign in to comment.