Commit Graph

14 Commits

Author SHA1 Message Date
David Glasser
590af5e8c2 Revert "Merge branch 'websocket-compression-take-2' into devel"
This reverts commit 5d3cfa2d76, reversing
changes made to 2b466a9015.

Ah well, we tried to enable websocket compression again and ran into
more bugs.

First, newer versions of websocket-driver seem to sometimes send
duplicate close messages:
https://github.com/faye/faye-websocket-node/issues/41

This occurs whether or not deflate is actually used.

Second, in some circumstances permessage-deflate seems to completely
corrupt messages. This was reasonably easily observable by running
test-packages with Chrome, and seeing that sometimes (but not always) a
large number of bad JSON messages got printed to the client
console.  (Another symptom was that the total number of tests would be
larger than it should be, leading to messages like "Passed 1109 of
1153", presumably because the test name got corrupted in some status
messages.) https://github.com/faye/permessage-deflate-node/issues/4

See #3007.
2015-03-09 15:10:50 -07:00
David Glasser
9f5a97b9f0 Revert "Revert "Use per-message websocket compression""
This reverts commit 60ba1f403b.

Faye has fixed the bugs that blocked turning this on in the past:
  https://github.com/faye/permessage-deflate-node/issues/1
  https://github.com/faye/permessage-deflate-node/pull/3
  https://github.com/faye/websocket-driver-node/issues/11
2015-03-05 16:54:58 -08:00
David Glasser
60ba1f403b Revert "Use per-message websocket compression"
This reverts commit 67bea9c102.

See https://github.com/faye/permessage-deflate-node/issues/1

This can be consistently replicated by running test-packages ddp (note
that the tests pass but then the server crashes). "livedata server -
connection in publish function" specifically is enough
2015-01-08 14:26:28 -08:00
David Glasser
67bea9c102 Use per-message websocket compression
By default, we attempt to use this for every websocket message on both
client and server.

On the server, we provide the SERVER_WEBSOCKET_COMPRESSION environment
variable to control compression. If $SERVER_WEBSOCKET_COMPRESSION is
set, then it must be valid JSON. If it represents a falsey value, then
we do not use permessage-deflate at all; otherwise, the JSON value is
used as an argument to deflate's configure method; see
https://github.com/faye/permessage-deflate-node/blob/master/README.md

We do not provide a way to use it only on some messages. The underlying
spec allows this but permessage-deflate does not; see
https://github.com/faye/permessage-deflate-node/issues/2

We do not provide a mechanism to control compression parameters on the
client side.  The assumption is that the common reason to care about
compression parameters is to control server per-connection memory
usage. (The noContextTakeover configuration parameter should save some
memory and still allow for some compression, for example.)

Addresses #3007 (which will not be fixed until this change is deployed
on the package server as well).
2015-01-08 12:08:13 -08:00
David Glasser
3a61be67ab Use Faye's proxy support. 2014-11-12 16:14:45 -08:00
David Glasser
f9766a123f Revert "server DDP: Use low-level websocket-driver module"
This reverts commit a98c6d030a.
2014-11-12 15:58:00 -08:00
David Glasser
cea791f7c9 Revert "factor out creation of socket"
This reverts commit ac0014d852.
2014-11-12 15:58:00 -08:00
David Glasser
3a54db35c6 Revert "Support $HTTPS_PROXY in Node DDP client."
(Let a comment in tools remain.)

This reverts commit fb7921ade2.
2014-11-12 15:58:00 -08:00
David Glasser
1956f7b9c7 Revert "Cargo cult more cleanup code from faye"
This reverts commit b0d47e10bc.
2014-11-12 15:57:59 -08:00
David Glasser
b0d47e10bc Cargo cult more cleanup code from faye
See https://github.com/faye/faye-websocket-node/commit/29d07c50022d1b
2014-10-26 10:50:41 -07:00
David Glasser
fb7921ade2 Support $HTTPS_PROXY in Node DDP client.
This should mean that you can access the package server from behind a
corporate firewall.

I tested this by setting up a Linux machine that doesn't have access to
packages.meteor.com:

   $ sudo iptables -A OUTPUT -d 54.225.216.115 -j DROP
   $ sudo iptables -A OUTPUT -d 184.72.252.20 -j DROP
   $ sudo iptables -A OUTPUT -d 23.23.114.56 -j DROP

I confirmed that these commands both fail:

  $ curl https://packages.meteor.com/
  $ ./meteor search asdf   # when it needs to sync first

I bought a proxy server from Proxy Bonanza and confirmed that setting
the environment variable HTTPS_PROXY to
   https://PROXYUSERNAME:PROXYPASSWORD@PROXYIP:PROXYPORT/
made both of the commands above succeed.

Fixes #2515.
2014-10-10 14:49:05 -07:00
David Glasser
ac0014d852 factor out creation of socket 2014-10-10 14:46:51 -07:00
David Glasser
a98c6d030a server DDP: Use low-level websocket-driver module
We want to support running DDP through a corporate proxy, but the
higher-level faye-websocket can't support that and won't be changed to
allow that: https://github.com/faye/faye-websocket-node/pull/30

Fair enough. Let's just switch to the lower-level module, since we don't
care about getting a browser-compatible websocket API.

This is a first step towards fixing #2515.
2014-10-08 18:07:11 -07:00
Sashko Stubailo
3189a364e9 Rename livedata to ddp, meteor test-packages passes 2014-08-28 12:53:34 -07:00