sockjs-client
Advanced tools
Comparing version 1.0.0-beta.12 to 1.0.0-beta.13
@@ -0,1 +1,6 @@ | ||
1.0.0-beta.13 | ||
=== | ||
* Transport timeout on connection should fallback - #238 | ||
1.0.0-beta.12 | ||
@@ -2,0 +7,0 @@ ==== |
@@ -15,2 +15,3 @@ 'use strict'; | ||
, browser = require('./utils/browser') | ||
, log = require('./utils/log') | ||
, Event = require('./event/event') | ||
@@ -49,2 +50,5 @@ , EventTarget = require('./event/eventtarget') | ||
options = options || {}; | ||
if (options.protocols_whitelist) { | ||
log.warn("'protocols_whitelist' is DEPRECATED. Use 'transports' instead."); | ||
} | ||
this._transportsWhitelist = options.transports; | ||
@@ -95,10 +99,5 @@ this._server = options.server || random.numberString(1000); | ||
// basic authentication | ||
parsedUrl.auth = parsedUrl.username | ||
? parsedUrl.username + ':' + parsedUrl.password + '@' | ||
: ''; | ||
// store the sanitized url | ||
this.url = parsedUrl.protocol + '//' + parsedUrl.auth + parsedUrl.hostname + | ||
(parsedUrl.port ? ':' + parsedUrl.port : '') + parsedUrl.path; | ||
this.url = parsedUrl.protocol + '//' + (parsedUrl.auth ? parsedUrl.auth + '@' : '') + | ||
parsedUrl.hostname + (parsedUrl.port ? ':' + parsedUrl.port : '') + parsedUrl.path; | ||
debug('using url', this.url); | ||
@@ -212,7 +211,7 @@ | ||
debug('transport url', transportUrl); | ||
var transport = new Transport(transportUrl, this._transUrl); | ||
transport.on('message', this._transportMessage.bind(this)); | ||
transport.once('close', this._transportClose.bind(this)); | ||
transport.transportName = Transport.transportName; | ||
this._transport = transport; | ||
var transportObj = new Transport(transportUrl, this._transUrl); | ||
transportObj.on('message', this._transportMessage.bind(this)); | ||
transportObj.once('close', this._transportClose.bind(this)); | ||
transportObj.transportName = Transport.transportName; | ||
this._transport = transportObj; | ||
@@ -227,3 +226,3 @@ return; | ||
if (this.readyState === SockJS.CONNECTING) { | ||
this._close(2007, 'Transport timed out'); | ||
this._transportClose(2007, 'Transport timed out'); | ||
} | ||
@@ -230,0 +229,0 @@ }; |
@@ -22,3 +22,3 @@ 'use strict'; | ||
method: method | ||
, hostname: parsedUrl.hostname | ||
, hostname: parsedUrl.hostname.replace(/\[|\]/g, '') | ||
, port: parsedUrl.port | ||
@@ -25,0 +25,0 @@ , path: parsedUrl.pathname + (parsedUrl.query || '') |
@@ -1,1 +0,1 @@ | ||
module.exports = '1.0.0-beta.12'; | ||
module.exports = '1.0.0-beta.13'; |
{ | ||
"name": "sockjs-client", | ||
"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.", | ||
"version": "1.0.0-beta.12", | ||
"version": "1.0.0-beta.13", | ||
"author": "Bryce Kahle", | ||
@@ -6,0 +6,0 @@ "browser": { |
@@ -65,3 +65,3 @@ | ||
* [SockJS-netty](https://github.com/cgbystrom/sockjs-netty) | ||
* [SockJS-gevent](https://github.com/sdiehl/sockjs-gevent) ([SockJS-gevent fork](https://github.com/njoyce/sockjs-gevent)) | ||
* [SockJS-gevent](https://github.com/ksava/sockjs-gevent) ([SockJS-gevent fork](https://github.com/njoyce/sockjs-gevent)) | ||
* [pyramid-SockJS](https://github.com/fafhrd91/pyramid_sockjs) | ||
@@ -160,2 +160,3 @@ * [wildcloud-websockets](https://github.com/wildcloud/wildcloud-websockets) | ||
Opera 10.70+ | no ‡ | iframe-eventsource | iframe-xhr-polling | ||
Opera 12.10+ | rfc6455 | xhr-streaming | xhr-polling | ||
Konqueror | no | no | jsonp-polling | ||
@@ -224,3 +225,3 @@ | ||
Although the main point of SockJS it to enable browser-to-server | ||
Although the main point of SockJS is to enable browser-to-server | ||
connectivity, it is possible to connect to SockJS from an external | ||
@@ -227,0 +228,0 @@ application. Any SockJS server complying with 0.3 protocol does |
126513
61
3046
325