freedomjs/freedom — pull request #46 by dborkan (2014-05-28 17:42:37+00:00)
Title: Add parameter to freedom.transport.setup to immediately initiate a connection, then fulfill promise when it succeeds.

Add parameter to freedom.transport.setup to immediately initiate a connection, then fulfill promise when it succeeds.

This is needed so that we can verify that a webrtc connection is established and won't set chrome's proxy settings before our socks-to-rtc proxy is up and running.

Rather than always try to initiate a connection, this is a boolean parameter with the intention that only 1 side of the webrtc connection will set this to true. In our case socks-to-rtc (client-side) sets the new param to true, but rtc-to-net (server-side) does not and just waits for the incoming connection.

Tested with "grunt test" (verified no new failures, as there had already been 4 failures), and manually by building freedom-for-chrome from this branch and testing in socks-rtc