pusher-js 8.4.0 → 8.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,388 +0,0 @@
1
- SockJS family:
2
-
3
- * [SockJS-client](https://github.com/sockjs/sockjs-client) JavaScript client library
4
- * [SockJS-node](https://github.com/sockjs/sockjs-node) Node.js server
5
- * [SockJS-erlang](https://github.com/sockjs/sockjs-erlang) Erlang server
6
- * [SockJS-lua](https://github.com/luvit/sockjs-luvit) Lua/Luvit server
7
- * [SockJS-tornado](https://github.com/MrJoes/sockjs-tornado) Python/Tornado server
8
- * [vert.x](https://github.com/vert-x/vert.x) Java/vert.x server
9
-
10
- Work in progress:
11
-
12
- * [SockJS-ruby](https://github.com/sockjs/sockjs-ruby)
13
- * [SockJS-netty](https://github.com/cgbystrom/sockjs-netty)
14
- * [SockJS-gevent](https://github.com/sdiehl/sockjs-gevent) ([SockJS-gevent fork](https://github.com/njoyce/sockjs-gevent))
15
- * [pyramid-SockJS](https://github.com/fafhrd91/pyramid_sockjs)
16
- * [wildcloud-websockets](https://github.com/wildcloud/wildcloud-websockets)
17
- * [SockJS-cyclone](https://github.com/flaviogrossi/sockjs-cyclone)
18
- * [SockJS-twisted](https://github.com/Fugiman/sockjs-twisted/)
19
- * [wai-SockJS](https://github.com/Palmik/wai-sockjs)
20
- * [SockJS-perl](https://github.com/vti/sockjs-perl)
21
-
22
-
23
- SockJS-client
24
- =============
25
-
26
- SockJS is a browser JavaScript library that provides a WebSocket-like
27
- object. SockJS gives you a coherent, cross-browser, Javascript API
28
- which creates a low latency, full duplex, cross-domain communication
29
- channel between the browser and the web server.
30
-
31
- Under the hood SockJS tries to use native WebSockets first. If that
32
- fails it can use a variety of browser-specific transport protocols and
33
- presents them through WebSocket-like abstractions.
34
-
35
- SockJS is intended to work for all modern browsers and in environments
36
- which don't support WebSocket protcol, for example behind restrictive
37
- corporate proxies.
38
-
39
- SockJS-client does require a server counterpart:
40
-
41
- * [SockJS-node](https://github.com/sockjs/sockjs-node) is a SockJS
42
- server for Node.js.
43
-
44
-
45
- Philosophy:
46
-
47
- * The API should follow
48
- [HTML5 Websockets API](http://dev.w3.org/html5/websockets/) as
49
- closely as possible.
50
- * All the transports must support cross domain connections out of the
51
- box. It's possible and recommended to host SockJS server on
52
- different server than your main web site.
53
- * There is a support for at least one streaming protocol for every
54
- major browser.
55
- * Streaming transports should work cross-domain and
56
- should support cookies (for cookie-based sticky sessions).
57
- * Polling transports are be used as a fallback for old browsers and
58
- hosts behind restrictive proxies.
59
- * Connection establishment should be fast and lightweight.
60
- * No Flash inside (no need to open port 843 - which doesn't work
61
- through proxies, no need to host 'crossdomain.xml', no need
62
- [to wait for 3 seconds](https://github.com/gimite/web-socket-js/issues/49)
63
- in order to detect problems)
64
-
65
-
66
- Subscribe to
67
- [SockJS mailing list](https://groups.google.com/forum/#!forum/sockjs) for
68
- discussions and support.
69
-
70
-
71
- Live QUnit tests and smoke tests
72
- --------------------------------
73
-
74
- SockJS comes with some QUnit tests and a few smoke tests (using
75
- [SockJS-node](https://github.com/sockjs/sockjs-client) on the server
76
- side). At the moment they are deployed in few places:
77
-
78
- * http://sockjs.popcnt.org/ and https://sockjs.popcnt.org/ (hosted in Europe)
79
- * http://sockjs.cloudfoundry.com/ (CloudFoundry, websockets disabled, loadbalanced)
80
- * https://sockjs.cloudfoundry.com/ (CloudFoundry SSL, websockets disabled, loadbalanced)
81
-
82
-
83
- Example
84
- -------
85
-
86
- SockJS mimics [WebSockets API](http://dev.w3.org/html5/websockets/)
87
- but instead of `WebSocket` there is a `SockJS` Javascript object.
88
-
89
- First, you need to load SockJS JavaScript library, for example you can
90
- put that in your http head:
91
-
92
- <script src="http://cdn.sockjs.org/sockjs-0.3.min.js">
93
- </script>
94
-
95
- After the script is loaded you can establish a connection with the
96
- SockJS server. Here's a simple example:
97
-
98
- ```javascript
99
- <script>
100
- var sock = new SockJS('http://mydomain.com/my_prefix');
101
- sock.onopen = function() {
102
- console.log('open');
103
- };
104
- sock.onmessage = function(e) {
105
- console.log('message', e.data);
106
- };
107
- sock.onclose = function() {
108
- console.log('close');
109
- };
110
- </script>
111
- ```
112
-
113
- SockJS-client API
114
- -----------------
115
-
116
- ### SockJS class
117
-
118
- Similar to 'WebSocket' class 'SockJS' constructor takes one, or more arguments:
119
-
120
- ```javascript
121
- var sockjs = new SockJS(url, _reserved, options);
122
- ```
123
-
124
- Where `options` is a hash which can contain:
125
-
126
- * **debug (boolean)**
127
-
128
- Print some debugging messages using 'console.log'.
129
-
130
- * **devel (boolean)**
131
-
132
- Development mode. Currently setting it disables caching of the
133
- 'iframe.html'.
134
-
135
- * **protocols_whitelist (list of strings)**
136
-
137
- Sometimes it is useful to disable some fallback protocols. This
138
- option allows you to supply a list protocols that may be used by
139
- SockJS. By default all available protocols will be used, which is
140
- equivalent to supplying: "['websocket', 'xdr-streaming', 'xhr-streaming',
141
- 'iframe-eventsource', 'iframe-htmlfile', 'xdr-polling', 'xhr-polling',
142
- 'iframe-xhr-polling', 'jsonp-polling']"
143
-
144
-
145
- Although the 'SockJS' object tries to emulate the 'WebSocket'
146
- behaviour, it's impossible to support all features. One of the
147
- important SockJS limitations is the fact that you're not allowed to
148
- open more than one SockJS connection to a single domain at a time.
149
- This limitation is caused by a in-browser limit of outgoing
150
- connections - usually [browsers don't allow opening more than two
151
- outgoing connections to a single domain](http://stackoverflow.com/questions/985431/max-parallel-http-connections-in-a-browser). Single SockJS session
152
- requires those two connections - one for downloading data, other for
153
- sending messages. Opening second SockJS session at the same time
154
- would most probably block and can result in both sessions timing out.
155
-
156
- Opening more than one SockJS connection at a time is generally a
157
- bad practice. If you absolutely must do it, you can use
158
- mutliple subdomains, using different subdomain for every
159
- SockJS connection.
160
-
161
- Supported transports, by browser (html served from http:// or https://)
162
- -----------------------------------------------------------------------
163
-
164
- _Browser_ | _Websockets_ | _Streaming_ | _Polling_
165
- ----------------|------------------|-------------|-------------------
166
- IE 6, 7 | no | no | jsonp-polling
167
- IE 8, 9 (cookies=no) | no | xdr-streaming &dagger; | xdr-polling &dagger;
168
- IE 8, 9 (cookies=yes)| no | iframe-htmlfile | iframe-xhr-polling
169
- IE 10 | rfc6455 | xhr-streaming | xhr-polling
170
- Chrome 6-13 | hixie-76 | xhr-streaming | xhr-polling
171
- Chrome 14+ | hybi-10 / rfc6455| xhr-streaming | xhr-polling
172
- Firefox <10 | no &Dagger; | xhr-streaming | xhr-polling
173
- Firefox 10+ | hybi-10 / rfc6455| xhr-streaming | xhr-polling
174
- Safari 5 | hixie-76 | xhr-streaming | xhr-polling
175
- Opera 10.70+ | no &Dagger; | iframe-eventsource | iframe-xhr-polling
176
- Konqueror | no | no | jsonp-polling
177
-
178
-
179
- * **&dagger;**: IE 8+ supports [XDomainRequest][^9], which is
180
- esentially a modified AJAX/XHR that can do requests across
181
- domains. But unfortunately it doesn't send any cookies, which
182
- makes it inaproppriate for deployments when the load balancer uses
183
- JSESSIONID cookie to do sticky sessions.
184
-
185
- * **&Dagger;**: Firefox 4.0 and Opera 11.00 and shipped with disabled
186
- Websockets "hixie-76". They can still be enabled by manually
187
- changing a browser setting.
188
-
189
- Supported transports, by browser (html served from file://)
190
- -----------------------------------------------------------
191
-
192
- Sometimes you may want to serve your html from "file://" address - for
193
- development or if you're using PhoneGap or similar technologies. But
194
- due to the Cross Origin Policy files served from "file://" have no
195
- Origin, and that means some of SockJS transports won't work. For this
196
- reason the SockJS protocol table is different than usually, major
197
- differences are:
198
-
199
- _Browser_ | _Websockets_ | _Streaming_ | _Polling_
200
- ----------------|---------------|--------------------|-------------------
201
- IE 8, 9 | same as above | iframe-htmlfile | iframe-xhr-polling
202
- Other | same as above | iframe-eventsource | iframe-xhr-polling
203
-
204
- Supported transports, by name
205
- -----------------------------
206
-
207
- _Transport_ | _References_
208
- ---------------------|---------------
209
- websocket (rfc6455) | [rfc 6455][^10]
210
- websocket (hixie-76) | [draft-hixie-thewebsocketprotocol-76][^1]
211
- websocket (hybi-10) | [draft-ietf-hybi-thewebsocketprotocol-10][^2]
212
- xhr-streaming | Transport using [Cross domain XHR][^5] [streaming][^7] capability (readyState=3).
213
- xdr-streaming | Transport using [XDomainRequest][^9] [streaming][^7] capability (readyState=3).
214
- iframe-eventsource | [EventSource][^4] used from an [iframe via postMessage][^3].
215
- iframe-htmlfile | [HtmlFile][^8] used from an [iframe via postMessage][^3].
216
- xhr-polling | Long-polling using [cross domain XHR][^5].
217
- xdr-polling | Long-polling using [XDomainRequest][^9].
218
- iframe-xhr-polling | Long-polling using normal AJAX from an [iframe via postMessage][^3].
219
- jsonp-polling | Slow and old fashioned [JSONP polling][^6]. This transport will show "busy indicator" (aka: "spinning wheel") when sending data.
220
-
221
-
222
- [^1]: http://tools.ietf.org/html/draft-hixie-thewebsocketprotocol-76
223
- [^2]: http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-10
224
- [^3]: https://developer.mozilla.org/en/DOM/window.postMessage
225
- [^4]: http://dev.w3.org/html5/eventsource/
226
- [^5]: https://secure.wikimedia.org/wikipedia/en/wiki/XMLHttpRequest#Cross-domain_requests
227
- [^6]: https://secure.wikimedia.org/wikipedia/en/wiki/JSONP
228
- [^7]: http://www.debugtheweb.com/test/teststreaming.aspx
229
- [^8]: http://cometdaily.com/2007/11/18/ie-activexhtmlfile-transport-part-ii/
230
- [^9]: http://blogs.msdn.com/b/ieinternals/archive/2010/05/13/xdomainrequest-restrictions-limitations-and-workarounds.aspx
231
- [^10]: http://www.rfc-editor.org/rfc/rfc6455.txt
232
-
233
-
234
- Connecting to SockJS without the client
235
- ---------------------------------------
236
-
237
- Although the main point of SockJS it to enable browser-to-server
238
- connectivity, it is possible to connect to SockJS from an external
239
- application. Any SockJS server complying with 0.3 protocol does
240
- support a raw WebSocket url. The raw WebSocket url for the test server
241
- looks like:
242
-
243
- * ws://localhost:8081/echo/websocket
244
-
245
- You can connect any WebSocket RFC 6455 compliant WebSocket client to
246
- this url. This can be a command line client, external application,
247
- third party code or even a browser (though I don't know why you would
248
- want to do so).
249
-
250
-
251
- Deployment
252
- ----------
253
-
254
- In order to utilize best performance you should use the SockJS-client
255
- releases hosted on SockJS CDN. You should use a version of sockjs-client
256
- that supports the protocol used by your server. For example:
257
-
258
- <script src="http://cdn.sockjs.org/sockjs-0.3.min.js">
259
- </script>
260
-
261
- A list of files hosted on a CDN is available here: http://sockjs.github.com/sockjs-client/ .
262
-
263
- You can also use or CDN via https (using Cloud Front domain name):
264
-
265
- <script src="https://d1fxtkz8shb9d2.cloudfront.net/sockjs-0.3.js">
266
- </script>
267
-
268
- For server-side deployment tricks, especially about load balancing and
269
- session stickiness, take a look at the
270
- [SockJS-node readme](https://github.com/sockjs/sockjs-node#readme).
271
-
272
-
273
- Development and testing
274
- -----------------------
275
-
276
- SockJS-client needs [Node.js](http://nodejs.org/) for running a test
277
- server and JavaScript minification. If you want to work on
278
- SockJS-client source code, check out the git repo and follow this
279
- steps:
280
-
281
- cd sockjs-client
282
- npm install
283
- npm install --dev
284
-
285
- To generate JavaScript run:
286
-
287
- make sockjs.js
288
-
289
- To generate minified JavaScript run:
290
-
291
- make sockjs.min.js
292
-
293
- (To generate both run `make build`.)
294
-
295
-
296
- ### Testing
297
-
298
- Once you compiled SockJS-client you may want to check if your changes
299
- pass all the tests. To run the tests you need a server that can answer
300
- various SockJS requests. A common way is to use `SockJS-node` test
301
- server for that. To run it (by default it will be listening on port 8081):
302
-
303
- cd sockjs-node
304
- npm install
305
- npm install --dev
306
- make build
307
- make test_server
308
-
309
- At this point you're ready to run a SockJS-client server that will
310
- server your freshly compiled JavaScript and various static http and
311
- javscript files (by default it will run on port 8080).
312
-
313
- cd sockjs-client
314
- make test
315
-
316
- At that point you should have two web servers running: sockjs-node on
317
- 8081 and sockjs-client on 8080. When you open the browser on
318
- [http://localhost:8080/](http://localhost:8080/) you should be able
319
- run the QUnit tests against your sockjs-node server.
320
-
321
- If you look at your browser console you will see warnings like that:
322
-
323
- Incompatibile SockJS! Main site uses: "a", the iframe: "b".
324
-
325
- This is due to a fact that SockJS-node test server is using compiled
326
- javascript from CDN, rather than your freshly compiled version. To fix
327
- that you must amend `sockjs_url` that is used by SockJS-node test
328
- server. Edit the [`config.js`](https://github.com/sockjs/sockjs-node/blob/master/examples/test_server/config.js) file:
329
-
330
- vim sockjs-node/examples/test_server/config.js
331
-
332
- And replace `sockjs_url` setting which by default points to CDN:
333
-
334
- sockjs_url: 'http://cdn.sockjs.org/sockjs-0.3.min.js',
335
-
336
- to a freshly compiled sockjs, for example:
337
-
338
- sockjs_url: 'http://localhost:8080/lib/sockjs.js',
339
-
340
-
341
- Also, if you want to run tests agains SockJS server not running on
342
- `localhost:8081` you may want to edit the
343
- [`tests/config.js`](https://github.com/sockjs/sockjs-client/blob/master/tests/config.js)
344
- file.
345
-
346
- Additionally, if you're doing more serious development consider using
347
- `make serve`, which will automatically reload the server when you
348
- modify the source code.
349
-
350
-
351
- Browser Quirks
352
- --------------
353
-
354
- There are various browser quirks which we don't intend to address:
355
-
356
- * Pressing ESC in Firefox closes SockJS connection. For a workaround
357
- and discussion see [#18](https://github.com/sockjs/sockjs-client/issues/18).
358
- * Jsonp-polling transport will show a "spinning wheel" (aka. "busy indicator")
359
- when sending data.
360
- * You can't open more than one SockJS connection to one domain at the
361
- same time due to [the browsers limit of consurrent connections](http://stackoverflow.com/questions/985431/max-parallel-http-connections-in-a-browser)
362
- (this limit is not counting native websockets connections).
363
- * Although SockJS is trying to escape any strange Unicode characters
364
- (even invalid ones - [like surrogates \xD800-\xDBFF](http://en.wikipedia.org/wiki/Mapping_of_Unicode_characters#Surrogates) or [\xFFFE and \xFFFF](https://en.wikipedia.org/wiki/Unicode#Character_General_Category))
365
- it's advisable to use only valid characters. Using invalid
366
- characters is a bit slower, and may not work with SockJS servers
367
- that have a proper Unicode support.
368
- * Having a global function called `onmessage` or such is probably a
369
- bad idea, as it could be called by the built-in `postMessage` API.
370
- * From SockJS point of view there is nothing special about
371
- SSL/HTTPS. Connecting between unencrypted and encrypted sites
372
- should work just fine.
373
- * Although SockJS does best to support both prefix and cookie based
374
- sticky sessions, the latter may not work well cross-domain with
375
- browsers that don't accept third-party cookies by default (Safari).
376
- In order to get around this make sure you're connecting to sockjs
377
- from the same parent domain as the main site. For example
378
- 'sockjs.a.com' is able to set cookies if you're connecting from
379
- 'www.a.com' or 'a.com'.
380
- * Trying to connect from secure "https://" to insecure "http://" is
381
- not good idea. The other way around should be fine.
382
- * Long polling is known to cause problems on Heroku, but
383
- [workaround for SockJS is available](https://github.com/sockjs/sockjs-node/issues/57#issuecomment-5242187).
384
- * Don't use "javascript:" links on a page that uses SockJS. For
385
- some reason clickling on this type of link breaks XDR/XHR requests
386
- on IE (see [#90](https://github.com/sockjs/sockjs-client/issues/90)).
387
- * SockJS [websocket transport is more stable over SSL](https://github.com/sockjs/sockjs-client/issues/94). If you're a serious SockJS user consider using SSL.
388
- over SSL](https://github.com/sockjs/sockjs-client/issues/94).
@@ -1,17 +0,0 @@
1
- #!/bin/sh
2
-
3
- LF='
4
- '
5
-
6
- VN=$(git describe --match "v[0-9]*" --abbrev=4 HEAD 2>/dev/null)
7
- case "$VN" in
8
- *$LF*) (exit 1) ;;
9
- v[0-9]*)
10
- git update-index -q --refresh
11
- test -z "$(git diff-index --name-only HEAD --)" ||
12
- VN="$VN-dirty" ;;
13
- esac
14
- VN=$(echo "$VN" | sed -e 's/-/./g');
15
- VN=$(expr "$VN" : v*'\(.*\)')
16
-
17
- echo "$VN"
@@ -1,111 +0,0 @@
1
- #!/usr/bin/env coffee
2
- #
3
- # ***** BEGIN LICENSE BLOCK *****
4
- # Copyright (c) 2011-2012 VMware, Inc.
5
- #
6
- # For the license see COPYING.
7
- # ***** END LICENSE BLOCK *****
8
-
9
-
10
- fs = require('fs')
11
- uglify = require('uglify-js')
12
- optparse = require('optparse')
13
-
14
- array_flatten = (arr, acc) ->
15
- if typeof acc is 'undefined'
16
- acc = []
17
- if typeof arr is 'string'
18
- acc.push(arr)
19
- return acc
20
-
21
- if arr.constructor isnt Array
22
- throw "Value is not an Array nor a String!"
23
-
24
- for v in arr
25
- if typeof v is 'string'
26
- acc.push(v)
27
- else if v.constructor is Array
28
- array_flatten(v, acc)
29
- else
30
- throw "Value is not an Array nor a String!"
31
- return acc
32
-
33
- stringify_unicode = (str) ->
34
- str = str.replace /[\u0100-\uffff]/g, (ch) ->
35
- return "\\u" + ('0000' + ch.charCodeAt(0).toString(16)).substr(-4)
36
- str = str.replace /[\x00-\x08\x0b-\x1f\x7f-\xff]/g, (ch) ->
37
- return "\\x" + ('00' + ch.charCodeAt(0).toString(16)).substr(-2)
38
- return str
39
-
40
-
41
- minify = (data, minify_options)->
42
- ast = uglify.parser.parse(data)
43
- ast = uglify.uglify.ast_mangle(ast, minify_options)
44
- ast = uglify.uglify.ast_squeeze(ast)
45
- uglify.uglify.gen_code(ast, minify_options)
46
-
47
- render = (filename, depth, options) ->
48
- tags =
49
- include: (args) ->
50
- if (args.length > 1 and args[1].indexOf('c') isnt -1 and
51
- options.minify is false)
52
- options.comment = true
53
- render(args[0], depth + ' ', options)
54
- version: ->
55
- options.version
56
- include_and_minify: (args) ->
57
- if (args.length > 1 and args[1].indexOf('c') isnt -1 and
58
- options.minify is false)
59
- options.comment = true
60
- d = render(args[0], depth + ' ', options)
61
- if options.minify
62
- return minify(array_flatten(d).join(''), options)
63
- return d
64
-
65
- console.warn(depth + " [.] Rendering", filename)
66
-
67
- # no trailing whitespace
68
- data = fs.readFileSync(filename, encoding='utf8').replace(/\s+$/, '')
69
-
70
- content = []
71
- if options.comment
72
- content.push('\n// ' + depth + '[*] Including ' + filename + '\n')
73
-
74
- elements = data.split(/<!--\s*([^>]+)\s*-->/g)
75
- for i in [0...elements.length]
76
- e = elements[i];
77
- if i % 2 is 0
78
- content.push(e)
79
- else
80
- p = e.split(' ')
81
- content.push( tags[p[0]](p.slice(1)) )
82
-
83
- if options.comment
84
- content.push('\n// ' + depth + '[*] End of ' + filename + '\n')
85
- return content
86
-
87
-
88
- main = ->
89
- switches = [
90
- ['-p', '--pretty', 'Prettify javascript']
91
- ['-m', '--minify', 'Minify javascript']
92
- ['-s', '--set-version [VERSION]', 'Set the value of version tag']
93
- ]
94
- options = {minify: false, toplevel: true, version: 'unknown'}
95
- parser = new optparse.OptionParser(switches)
96
- parser.on 'pretty', ->
97
- options.beautify = true
98
- parser.on 'minify', ->
99
- options.minify = true
100
- parser.on 'set-version', (_, version) ->
101
- options.version = version
102
- filenames = parser.parse((process.ARGV || process.argv).slice(2))
103
-
104
- content = for filename in filenames
105
- render(filename, '', options)
106
- content.push('\n')
107
- process.stdout.write(
108
- stringify_unicode(array_flatten(content).join('')),
109
- 'utf8')
110
-
111
- main()
@@ -1,135 +0,0 @@
1
- #!/bin/bash
2
- # Include a script with credentails:
3
- . .testling_env.sh
4
- # This script should set few Testling variables and should look more
5
- # or less like that:
6
- #
7
- # TESTLING_CRED=my@email.com:password
8
- # TUNNEL_PORT=12345
9
- # TUNNEL_USER=my_email_com
10
- #
11
- # First, you need to create browserling.com account. Set TESTLING_CRED
12
- # to email:password. Additionally, you must create a testling tunnel
13
- # using commands like that:
14
- #
15
- # curl -u $TESTLING_CRED "testling.com/tunnel" -sST ~/.ssh/id_rsa.pub
16
- # curl -u $TESTLING_CRED "testling.com/tunnel/open"
17
- #
18
- # After that set TUNNEL_PORT and TUNNEL_USER accordingly.
19
- #
20
- #
21
-
22
- browsers=(
23
- # iexplore/6.0
24
- # iexplore/7.0
25
- # iexplore/8.0
26
- # iexplore/9.0
27
- # chrome/4.0
28
- # chrome/5.0
29
- # chrome/6.0
30
- # chrome/7.0
31
- # chrome/8.0
32
- # chrome/9.0
33
- # chrome/10.0
34
- # chrome/11.0
35
- # chrome/12.0
36
- # chrome/13.0
37
- # chrome/14.0
38
- # chrome/15.0
39
- chrome/canary
40
- # firefox/3.0
41
- # firefox/3.5
42
- # firefox/3.6
43
- # firefox/4.0
44
- # firefox/5.0
45
- # firefox/6.0
46
- # firefox/7.0
47
- # firefox/8.0
48
- # firefox/nightly
49
- # opera/10.0
50
- # opera/10.5
51
- # opera/11.0
52
- # opera/11.5
53
- # opera/next
54
- # safari/5.0.5
55
- # safari/5.1
56
- )
57
-
58
- BROWSERS=`echo ${browsers[@]}|tr ' ' ','`
59
-
60
-
61
- if [ "$TESTLING_CRED" = "" ] || \
62
- [ "$TUNNEL_PORT" = "" ] || \
63
- [ "$TUNNEL_USER" = "" ]; then
64
- echo "Error: Please set following env variables: "\
65
- "TESTLING_CRED TUNNEL_PORT TUNNEL_USER"
66
- exit 1
67
- fi
68
-
69
-
70
- PIDFILE=.sshpidfile.pid
71
-
72
- if [ -e $PIDFILE ]; then
73
- kill `cat $PIDFILE`
74
- rm $PIDFILE
75
- fi
76
-
77
-
78
-
79
- cat > testling.js << EOF
80
- var test = require('testling');
81
- test('Testling Test Runner', function (t) {
82
- t.createWindow('http://tunnel.browserling.com:$TUNNEL_PORT/unittests.html',
83
- function(win, jq) {
84
- jq(function() {
85
- if(typeof win.QUnit === 'undefined') {
86
- t.log("No QUnit object in the window!");
87
- t.end();
88
- } else {
89
- var q = win.QUnit;
90
- var module_name = '[unknown]';
91
- q.begin = function() {
92
- t.log(' [*] Start');
93
- };
94
- q.moduleStart = function(o) {
95
- module_name = o.name;
96
- };
97
- q.log = function(o) {
98
- var x = module_name + ': ' + o.message;
99
- t.ok(o.result, x);
100
- if(!o.result) {
101
- t.log(" [-] Failed: " + x);
102
- }
103
- };
104
- q.done = function(o) {
105
- t.log(' [*] Done ' + o.failed + ' ' + o.passed +
106
- ' ' + o.total + ' ' + o.runtime);
107
- t.end();
108
- };
109
- }
110
- });
111
- });
112
- // Dead man's switch
113
- setTimeout(function(){
114
- t.log("Emergency timeout ocurred");
115
- t.end();
116
- }, 5000);
117
- });
118
- EOF
119
-
120
-
121
-
122
- ssh -o "VerifyHostKeyDNS no" \
123
- -NR $TUNNEL_PORT:localhost:8080 $TUNNEL_USER@tunnel.browserling.com &
124
- SSHPID=$!
125
- echo $SSHPID > $PIDFILE
126
-
127
- echo "[*] Running against: ${browsers[@]}"
128
- curl -u $TESTLING_CRED -sSNT testling.js \
129
- "testling.com/?browsers=$BROWSERS&noinstrument=test.js"
130
-
131
- kill $SSHPID
132
- wait $SSHPID
133
- rm $PIDFILE
134
-
135
- curl -sSNu $TESTLING_CRED "testling.com/browsers"|tail -n 1
@@ -1,18 +0,0 @@
1
- {
2
- "name" : "sockjs-client",
3
- "author" : "Marek Majkowski",
4
- "version" : "0.0.0-unreleasable",
5
- "description" : "SockJS-client is a browser JavaScript library that provides a WebSocket-like object. SockJS gives you a coherent, cross-browser, Javascript API which creates a low latency, full duplex, cross-domain communication channel between the browser and the web server.",
6
- "keywords" : ["websockets", "websocket"],
7
- "homepage" : "http://sockjs.org",
8
-
9
- "repository": {"type" : "git",
10
- "url" : "https://github.com/sockjs/sockjs-client.git"},
11
- "devDependencies": {
12
- "uglify-js" : "1.2.5",
13
- "coffee-script" : "1.2.x",
14
- "optparse" : "1.0.3",
15
- "node-static" : "0.5.9"
16
- },
17
- "main": "sockjs.js"
18
- }
@@ -1 +0,0 @@
1
- 0.3.4