Comparing version 2.0.1 to 2.0.2
@@ -31,3 +31,3 @@ 'use strict'; | ||
* @param {String} message The reason for the error. | ||
* @param {EventEmitter} spark The spark that caused the error. | ||
* @param {Spark} spark The spark that caused the error. | ||
* @api public | ||
@@ -34,0 +34,0 @@ */ |
@@ -78,2 +78,8 @@ 'use strict'; | ||
// | ||
// Copy over the original Spark static properties and methods so readable and | ||
// writable can also be used. | ||
// | ||
for (var key in Spark) this.Spark[key] = Spark[key]; | ||
this.parsers(options.parser); | ||
@@ -80,0 +86,0 @@ this.initialise(options.transformer || options.transport, options); |
{ | ||
"name": "primus", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"description": "Primus is a simple abstraction around real-time frameworks. It allows you to easily switch between different frameworks without any code changes.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -272,3 +272,3 @@ /*globals require, define */ | ||
primus.latency = 0; // Latency between messages. | ||
primus.transport = options.transport || {}; // Transport options. | ||
primus.transport = options.transport; // Transport options. | ||
primus.transformers = { // Message transformers. | ||
@@ -541,3 +541,3 @@ outgoing: [], | ||
*/ | ||
Primus.prototype.initialise = function initalise(options) { | ||
Primus.prototype.initialise = function initialise(options) { | ||
var primus = this | ||
@@ -544,0 +544,0 @@ , start; |
@@ -79,2 +79,3 @@ # Primus | ||
- [RequireJS](#is-requirejs-supported) | ||
- [Custom headers](#can-i-send-custom-headers-to-the-server) | ||
- [Versioning](#versioning) | ||
@@ -122,4 +123,4 @@ - [History](#history) | ||
received from the client within the specified amount of time. It is possible | ||
to completly disable the heartbeat timeout by setting the value of the `timeout` | ||
option to `false`. | ||
to completely disable the heartbeat timeout by setting the value of the | ||
`timeout` option to `false`. | ||
@@ -148,5 +149,9 @@ In addition to support different frameworks we've also made it possible to use | ||
scope of this project. You can store this on a CDN or on your static server. Do | ||
whatever you want with it, but I would advice you to regenerate that file every | ||
time you redeploy so it always contains a client side library that is compatible | ||
with your back-end. To save the file you can use: | ||
whatever you want with it, but remember to regenerate it every time you change | ||
Primus server options. This is important because some properties of the client | ||
are set using the server configuration. For example if you change the | ||
`pathname`, the client should be regenerated to reflect that change and work | ||
correctly. We advice you to regenerate the library every time you redeploy so | ||
you always have a client compatible with your back-end. To save the file you | ||
can use: | ||
@@ -221,2 +226,7 @@ ```js | ||
*Please note that sending custom headers from the client to the server is | ||
impossible as not all transports that these transformers support can add custom | ||
headers to a request (JSONP for example). If you need to send custom data, use a | ||
query string when connecting* | ||
#### spark.address | ||
@@ -238,3 +248,3 @@ | ||
transformers, but it's proven to be to useful to not implement it because one | ||
silly transformer refuses to support it. Yes.. I'm looking at you SockJS. | ||
silly transformer refuses to support it. Yes, I'm looking at you SockJS. | ||
@@ -627,17 +637,17 @@ #### spark.id | ||
The transport object allows you to add transport specific configuration in to | ||
Primus. We only recommend using this if understand and accept the following | ||
The transport object allows you to add a transport specific configuration. | ||
We only recommend using this if you understand and accept the following | ||
consequences: | ||
- Primus will attempt to override properties that it needs in order to function | ||
properly inside this configuration. | ||
- We might start using options without any announcements or major version bumps. | ||
- Primus will try to override configuration properties that are needed to | ||
ensure a correct functioning. | ||
- We might start using options without any announcement or major version bump. | ||
- Expect your client and it's connection to malfunction once you switch between | ||
different transports as these are configuration changes that are specific to | ||
the bundled transformer library/client. | ||
- Bugs and bug reports that caused by using this functionality is closed | ||
different transports, as these configurations are specific to the bundled | ||
transformer library/client. | ||
- Bugs and bug reports caused by using this functionality are closed | ||
immediately. | ||
Having that said, this does give you ultimate freedom while still getting the | ||
benefits of Primus. | ||
Having that said, this gives you total freedom while still getting the benefits | ||
of Primus. | ||
@@ -1396,8 +1406,8 @@ #### primus.write(message) | ||
Scaling Primus is as simple as sticking it behind a load balancer that supports | ||
sticky sessions and run multiple versions of your application. This is a vital | ||
feature that your load balancer needs to support. This ensures that the incoming | ||
requests always go back to the same server. If your load balancer does not | ||
support sticky sessions, get another one. I highly recommend | ||
[HAProxy](http://haproxy.1wt.eu/). According to my own testing it the fastest | ||
and best proxy available that supports WebSockets. See | ||
[sticky sessions](https://github.com/primus/primus/issues/147) and run multiple | ||
versions of your application. This is a vital feature that your load balancer | ||
needs to support. This ensures that the incoming requests always go back to the | ||
same server. If your load balancer does not support sticky sessions, get another | ||
one. I highly recommend [HAProxy](http://haproxy.1wt.eu/). According to my own | ||
testing it the fastest and best proxy available that supports WebSockets. See | ||
https://github.com/observing/balancerbattle for more detailed information. | ||
@@ -1440,2 +1450,16 @@ | ||
#### Can I send custom headers to the server | ||
It is not possible to send custom headers from the client to the server. This is | ||
because these headers need to be set by the actual transports that the | ||
transformers are using. The only transport that would support this would be AJAX | ||
polling. To send custom data to the server use a query string in your connection | ||
URL, as this is something that all transports support. The only noticeable | ||
exception for this case is SockJS as it doesn't allow query strings in the | ||
connection URL. | ||
```js | ||
var primus = new Primus('http://localhost:8080/?token=1&name=foo'); | ||
``` | ||
### Versioning | ||
@@ -1442,0 +1466,0 @@ |
@@ -78,2 +78,4 @@ 'use strict'; | ||
socket.open(); | ||
} else { | ||
primus.emit('outgoing::open'); | ||
} | ||
@@ -80,0 +82,0 @@ }); |
@@ -29,5 +29,5 @@ # Transformer: Engine.IO | ||
1. Clone the repository: `https://github.com/LearnBoost/engine.io-client.git` | ||
2. Save and run `make build` | ||
2. cd in the directory and run `make build` | ||
3. Override the `library.js` with the newly created `engine.io.js` | ||
4. Commit changes to the Primus main repository. | ||
5. Profit |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
299768
37
7858
1507