Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
ee27864
Add gsolo SHA1 algorithm.
May 2, 2011
8b52ec4
com/gsolo/encryption/SHA1.as: stop compile warnings.
May 2, 2011
20c16e6
Fix protocol attribute handling.
May 2, 2011
4084a2c
Implement HyBi-07 version of the protocol.
May 2, 2011
128b3c7
Add HyBi-07 client masking.
May 2, 2011
9e67e24
Use byte length rather than character length.
kanaka May 6, 2011
fd5fa42
Merging.
gimite May 7, 2011
fa9e686
Merge branch 'master' into hybi-07
gimite May 7, 2011
4be643b
Merge remote branch 'gimite/master' into hybi-08
kanaka Aug 29, 2011
a308f86
Merge branch 'master' into hybi-07
gimite Sep 17, 2011
1646609
Style fixes.
gimite Sep 17, 2011
7e12c8a
Switching to hybi-10 protocol.
gimite Sep 17, 2011
a14e6f0
Implementing pong.
gimite Sep 18, 2011
c1e7a1a
Some more refactoring.
gimite Sep 18, 2011
24acbab
Fixing closing handshake.
gimite Sep 18, 2011
77507da
Updating README and adding NEWS.
gimite Sep 18, 2011
b54ae42
Updating NEWS.
gimite Sep 18, 2011
ba3d7af
Fixing a bug that decoded key was not 16 bytes.
gimite Sep 19, 2011
d3f2b90
Sending closing frame for some errors.
gimite Sep 19, 2011
23e7488
Handling IOError on send().
gimite Sep 25, 2011
f056e9f
Using status code to express connection error and server closing.
gimite Sep 25, 2011
55ae639
Adding wasClean, code, reason to onclose event object. Code was parti…
gimite Sep 26, 2011
1402307
Closing connection on masked frame from server. Issue #103
gimite Nov 5, 2011
4f7b9f8
Initializing automatically when web_socket.js is dynamically loaded.
gimite Dec 11, 2011
841b01d
Using swfobject.addDomLoadEvent() to simplify the initialization.
gimite Dec 14, 2011
b16e4ce
Using MozWebSocket when available. Issue #87
gimite Dec 17, 2011
47c316c
Firing close event on error in send(). Hopefully fixes issue #92 .
gimite Dec 17, 2011
30b0e3c
Switching to WebSocket version defined in RFC 6455.
gimite Dec 27, 2011
6ca1919
Updating README.
gimite Jan 30, 2012
2ee87e9
Adding reference to futurechimp's Ruby implementation of Flash socket…
gimite Mar 17, 2012
5c5ae54
@= flag of WebSocket implementation
abonec Aug 9, 2012
7677e7a
Renaming flash_implemented to __isFlashImplementation.
gimite Aug 9, 2012
1eb68ad
Include the patch from http://code.google.com/p/as3crypto/issues/deta…
jamadden Nov 1, 2012
10410eb
Rebuilding SWF files.
gimite Nov 3, 2012
b5f4ab7
Fixing a bug that it required whitespace after colon in the header. #126
gimite Dec 4, 2012
5c313e9
Add swfobject.js v2.2 source for DFSG compatibility.
kanaka Apr 12, 2013
7c4558f
Merge branch 'dfsg' of https://github.com/kanaka/web-socket-js
gimite Apr 25, 2013
c0855c6
Moving swfobject-src.js.
gimite Apr 25, 2013
0991abd
handle continuation frame from server #129
ken107 Jun 24, 2013
15db822
Recompiling SWF files.
gimite Jul 9, 2013
08cd896
Adding LICENCE.txt.
gimite Jul 9, 2013
c1fd4e0
Renaming license file.
gimite Jul 9, 2013
9c755f9
Fix for Issue #142
cope Dec 12, 2013
338760f
Using typeof(MessageEvent) to switch two ways to create MessageEvent.
gimite Dec 15, 2013
4405e7d
Adding bower.json. #148
gimite Jan 16, 2014
87ffc52
fix #151
x25 Mar 12, 2014
f64a2b9
Updating SWF files.
gimite Apr 3, 2014
35778e4
Remove moot `version` property from bower.json
kkirsche Jun 12, 2015
282e4d4
Merge pull request #162 from kkirsche/patch-1
gimite Jun 17, 2015
534dd4b
fix the empty cookie bug
lightsocks Oct 10, 2015
1ab03b3
Merge pull request #169 from lightsocks/master
gimite Oct 24, 2015
3010e94
Suppress SecurityError on processEvents(). #159
gimite Nov 7, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
test.html
WebSocket.swc
flash-src-websocket
9 changes: 9 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Copyright (c) 2013, Hiroshi Ichikawa
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
Neither the name of the Hiroshi Ichikawa nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
17 changes: 17 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
- 2011-12-27
- web-socket-js now speaks WebSocket defined in RFC 6455, which is
equivalent to hybi-13 to hybi-17. It no longer supports old draft
protocols.

- 2011-12-17
- web-socket-js now uses MozWebSocket when available. i.e. When you load
web_socket.js, WebSocket is defined as alias of MozWebSocket when
available.

- 2011-09-18
- web-socket-js now speaks WebSocket version hybi-10. Old versions spoke
hixie-76. If you really need web-socket-js which speaks hixie-76, you can
get it from
[hixie-76 branch](https://github.com/gimite/web-socket-js/tree/hixie-76),
but the branch is no longer maintained. Implementation of hybi-10 is
mostly done by Joel Martin (kanaka).
30 changes: 20 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@ $ ruby web-socket-ruby/samples/echo_server.rb example.com 10081

If it doesn't work, try these:

1. Try Chrome and Firefox 3.x.
1. Try Chrome and IE 8 or 9.

- It doesn't work on Chrome:<br>
It's likely an issue of your code or the server. Debug your code as usual e.g. using console.log.
- It works on Chrome but it doesn't work on Firefox:<br>
- It works on Chrome but it doesn't work on IE:<br>
It's likely an issue of web-socket-js specific configuration (e.g. 3 and 4 below).
- It works on both Chrome and Firefox, but it doesn't work on your browser:<br>
- It works on both Chrome and IE, but it doesn't work on your browser:<br>
Check "Supported environment" section below. Your browser may not be supported by web-socket-js.

2. Add this line before your code:
Expand All @@ -79,13 +79,20 @@ and use Developer Tools (Chrome/Safari) or Firebug (Firefox) to see if console.l

8. Install [debugger version of Flash Player](http://www.adobe.com/support/flashplayer/downloads.html) to see Flash errors.

9. If you followed the steps above and you still have an issue, please [report here](https://github.com/gimite/web-socket-js/issues) with these information:

- The WebSocket server library you use (e.g. em-websocket, pywebsocket) and its version
- The Web browser you use and its version
- The exact message you are trying to send from the server or the client
- The result of all steps above, especially error message in step 2 if any


## Supported environments

It should work on:

- Google Chrome 4 or later (just uses native implementation)
- Firefox 3.x, 4.x, Internet Explorer 8, 9 + Flash Player 10 or later
- Google Chrome 4 or later, Firefox 6 or later (uses native WebSocket or MozWebSocket implementation)
- Firefox 3 to 5, Internet Explorer 8, 9 + Flash Player 10 or later

It may or may not work on other browsers such as Safari, Opera or IE 6. Patch for these browsers are appreciated, but I will not work on fixing issues specific to these browsers by myself.

Expand All @@ -105,7 +112,11 @@ This implementation uses Flash's socket, which means that your server must provi

If you use [web-socket-ruby](http://github.com/gimite/web-socket-ruby/tree/master) or [em-websocket](https://github.com/igrigorik/em-websocket), you don't need anything special, because they handle Flash socket policy file request. But if you already provide socket policy file at port **843**, you need to modify the file to allow access to Web Socket port, because it precedes what the libraries provide.

If you use other Web Socket server implementation, you need to provide socket policy file yourself. See [Setting up A Flash Socket Policy File](http://www.lightsphere.com/dev/articles/flash_socket_policy.html) for details and sample script to run socket policy file server. [node.js implementation is available here](https://github.com/3rd-Eden/FlashPolicyFileServer).
If you use other Web Socket server implementation, you need to provide socket policy file yourself. See [Setting up A Flash Socket Policy File](http://www.lightsphere.com/dev/articles/flash_socket_policy.html) for details. Implementation of socket policy file server is available at:

- The article above (Perl implementation)
- [Ruby implementation](https://github.com/futurechimp/flash_policy_server)
- [Node.js implementation](https://github.com/3rd-Eden/FlashPolicyFileServer)

Actually, it's still better to provide socket policy file at port 843 even if you use web-socket-ruby or em-websocket. Flash always try to connect to port 843 first, so providing the file at port 843 makes startup faster.

Expand All @@ -121,7 +132,7 @@ Note that it's technically possible that client sends arbitrary string as Cookie

### Proxy support

[The WebSocket spec](http://tools.ietf.org/html/draft-hixie-thewebsocketprotocol) specifies instructions for User Agents to support proxied connections by implementing the HTTP CONNECT method.
[The WebSocket spec](http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-10) specifies instructions for User Agents to support proxied connections by implementing the HTTP CONNECT method.

The AS3 Socket class doesn't implement this mechanism, which renders it useless for the scenarios where the user trying to open a socket is behind a proxy.

Expand Down Expand Up @@ -149,9 +160,8 @@ Install [Flex 4 SDK](http://opensource.adobe.com/wiki/display/flexsdk/Download+F

## WebSocket protocol versions

- web-socket-js supports [Hixie 76 version](http://tools.ietf.org/html/draft-hixie-thewebsocketprotocol-76) of WebSocket protocol by default i.e. in [master branch](https://github.com/gimite/web-socket-js).
- If you want to try newer [Hybi 07 version](http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-07), check out from [hybi-07 branch](https://github.com/gimite/web-socket-js/tree/hybi-07). This will become the master branch in the future, probably when Chrome switches to Hybi 07.
- Hixie 75 or before is no longer supported.
- web-socket-js speaks WebSocket protocol defined in [RFC 6455](http://tools.ietf.org/html/rfc6455).
- web-socket-js doesn't speak old draft versions of WebSocket protocol including hixie-76, which was supported by old version of this library. If you really need web-socket-js which speaks hixie-76, you can get it from [hixie-76 branch](https://github.com/gimite/web-socket-js/tree/hixie-76), but the branch is no longer maintained.


## License
Expand Down
Binary file modified WebSocketMain.swf
Binary file not shown.
Binary file modified WebSocketMainInsecure.zip
Binary file not shown.
19 changes: 19 additions & 0 deletions bower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "gimite/web-socket-js",
"description": "HTML5 Web Socket implementation powered by Flash",
"license": "New BSD",
"ignore": [
"flash-src",
"src",
".gitignore",
"LICENSE.txt",
"NEWS.md",
"README.md",
"sample.html",
"WebSocketMainInsecure.zip"
],
"dependencies": {
},
"devDependencies": {
}
}
Loading