[Pkg-javascript-commits] [sockjs-client] 76/434: More readme

Tonnerre Lombard tonnerre-guest at moszumanska.debian.org
Wed Jan 8 00:47:02 UTC 2014


This is an automated email from the git hooks/post-receive script.

tonnerre-guest pushed a commit to branch master
in repository sockjs-client.

commit 6deef24608dcb6c74abf2a8528adbfbf7cd15072
Author: Marek Majkowski <majek04 at gmail.com>
Date:   Fri Aug 12 17:27:15 2011 +0100

    More readme
---
 README.md | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++----------
 1 file changed, 51 insertions(+), 10 deletions(-)

diff --git a/README.md b/README.md
index 60df14f..630ff05 100644
--- a/README.md
+++ b/README.md
@@ -1,24 +1,56 @@
-
 SockJS
 ======
 
-Pure JavaScript WebSockets-like API for browsers that don't support
-HTML5 or are running behind a restrictive proxy.
+SockJS is a JavaScript library that creates a WebSockets-like object,
+which allows low latency full duplex communication between browsers
+and your web servers.
+
+SockJS tries to use WebSockets, but it can use different transports
+for browsers that don't support HTML5 or are running behind a
+restrictive proxy.
 
 Philosophy:
 
- * No Flash inside (no need to open port 843 - which doesn't work
-   through proxies, no need to host `crossdomain.xml`, no need
-   [to wait for 3 seconds](https://github.com/gimite/web-socket-js/issues/49)
-   in order to detect that)
- * All the transports support cross domain connections. It's possible
-   and recommended to host SockJS server on different domain than your
-   main web site.
+ * All the transports support cross domain connections out of the
+   box. It's possible and recommended to host SockJS server on
+   different domain than your main web site.
  * There is a support for at least one streaming protocol for every
    major browser.
  * Polling transports are be used as a fallback for old browsers and
    hosts behind restrictive proxies.
+ * No Flash inside (no need to open port 843 - which doesn't work
+   through proxies, no need to host 'crossdomain.xml', no need
+   [to wait for 3 seconds](https://github.com/gimite/web-socket-js/issues/49)
+   in order to detect problems)
  * Connection establishment should be fast and lightweight.
+ * The API should follow [HTML5 Websockets API](http://dev.w3.org/html5/websockets/) as closely as possible (but we're not there yet).
+
+
+Example
+-------
+
+First, you need to load SockJS JavaScript library, for example you can
+put that in your http head:
+
+    <script src="http://majek.github.com/sockjs-client/sockjs-latest.min.js">
+      </script>
+
+After the script is loaded you can establish a connection with the
+SockJS server. Here's a simple example:
+
+    <script>
+      var sockjs = new SockJS('http://mydomain.com/my_prefix');
+      sockjs.onopen = function() {
+          console.log('open', e.data);
+      };
+      sockjs.onmessage = function(e) {
+          console.log('message', e.data);
+      };
+      sockjs.onclose = function(e) {
+          console.log('close', e.data);
+      };
+    </script>
+
 
 Supported transports
 --------------------
@@ -41,3 +73,12 @@ Protocol                                          | Browser
 [^5]: https://secure.wikimedia.org/wikipedia/en/wiki/XMLHttpRequest#Cross-domain_requests
 [^6]: https://secure.wikimedia.org/wikipedia/en/wiki/JSONP
 [^7]: http://www.debugtheweb.com/test/teststreaming.aspx
+
+
+Deployment
+----------
+
+There isn't a fully featured CDN yet, in the meantime you can use
+releases hosted on Github: http://majek.github.com/sockjs-client/ , or
+host the code yourself.
+

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/sockjs-client.git



More information about the Pkg-javascript-commits mailing list