Commit 5c166f50 authored by Arlo Breault's avatar Arlo Breault
Browse files

s/facilitator/broker/

parent 0abb3bd8
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -6,7 +6,7 @@ A Pluggable Transport using WebRTC

- Successfully bootstraps over WebRTC, both directly to a server plugin,
  as well as through the browser which proxies WebRTC to websocket.
- Needs work on signaling with the facilitator.
- Needs work on signaling with the broker.

### Usage

@@ -15,10 +15,10 @@ There are currently two ways to try this:
- Through a browser snowflake proxy.

Using the server plugin uses an HTTP server that simulates the interaction
that a client would have with a facilitator.
that a client would have with a broker.
Using the browser proxy (which will soon be the only way) requires copy and
pasting between 3 terminals and a browser tab.
Once a signalling facilitator is implemented 
Once a signaling broker is implemented
([issue #1](https://github.com/keroserene/snowflake/issues/1))
this will become much simpler to use.

+3 −3
Original line number Diff line number Diff line
@@ -10,7 +10,7 @@ $ torify ~/go_appengine/appcfg.py --no_cookies -A $YOUR_APP_ID update .
*/
package snowflake_broker

// host:port/basepath of the facilitator you want to register with
// for example, fp-facilitator.org or example.com:12345/facilitator
// host:port/basepath of the broker you want to register with
// for example, fp-broker.org or example.com:12345/broker
// https:// and /reg/ will be prepended and appended respectively.
const SNOWFLAKE_FACILITATOR = ""
const SNOWFLAKE_BROKER = ""
+3 −3
Original line number Diff line number Diff line
@@ -51,7 +51,7 @@ func regHandler(w http.ResponseWriter, r *http.Request) {

	// TODO: Get browser snowflake to talkto this appengine instance
	// so it can reply with an answer, and not just the offer again :)
	// TODO: Real facilitator which matches clients and snowflake proxies.
	// TODO: Real broker which matches clients and snowflake proxies.
	w.Write(body)
}

@@ -59,7 +59,7 @@ func init() {
	http.HandleFunc("/robots.txt", robotsTxtHandler)
	http.HandleFunc("/ip", ipHandler)
	http.HandleFunc("/reg/", regHandler)
	// if SNOWFLAKE_FACILITATOR == "" {
	// panic("SNOWFLAKE_FACILITATOR empty; did you forget to edit config.go?")
	// if SNOWFLAKE_BROKER == "" {
	// panic("SNOWFLAKE_BROKER empty; did you forget to edit config.go?")
	// }
}
+4 −4
Original line number Diff line number Diff line
@@ -77,7 +77,7 @@ class Snowflake
      @rateLimit = new BucketRateLimit(rateLimitBytes * RATE_LIMIT_HISTORY,
                                       RATE_LIMIT_HISTORY)

  # TODO: Should fetch from facilitator later.
  # TODO: Should fetch from broker later.
  setRelayAddr: (relayAddr) ->
    addr = Parse.address relayAddr
    if !addr
@@ -116,10 +116,10 @@ class Snowflake
    promise = @proxyPair.pc.createAnswer next
    promise.then next if promise

  # Poll facilitator when this snowflake can support more clients.
  # Poll broker when this snowflake can support more clients.
  proxyMain: ->
    if @proxyPairs.length >= MAX_NUM_CLIENTS * CONNECTIONS_PER_CLIENT
      setTimeout(@proxyMain, @facilitator_poll_interval * 1000)
      setTimeout(@proxyMain, @broker_poll_interval * 1000)
      return
    params = [['r', '1']]
    params.push ['transport', 'websocket']
@@ -185,7 +185,7 @@ Interface =
    $input.focus()

# Signalling channel - just tells user to copy paste to the peer.
# Eventually this should go over the facilitator.
# Eventually this should go over the broker.
Signalling =
  send: (msg) ->
    log '---- Please copy the below to peer ----\n'
+1 −1
Original line number Diff line number Diff line
// An HTTP-based signaling channel for the WebRTC server. It imitates the
// facilitator as seen by clients, but it doesn't connect them to an
// broker as seen by clients, but it doesn't connect them to an
// intermediate WebRTC proxy, rather connects them directly to this WebRTC
// server. This code should be deleted when we have proxies in place.