mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-13 20:11:19 -04:00
s/facilitator/broker/
This commit is contained in:
parent
0abb3bd856
commit
5c166f5015
5 changed files with 14 additions and 14 deletions
|
@ -6,7 +6,7 @@ A Pluggable Transport using WebRTC
|
||||||
|
|
||||||
- Successfully bootstraps over WebRTC, both directly to a server plugin,
|
- Successfully bootstraps over WebRTC, both directly to a server plugin,
|
||||||
as well as through the browser which proxies WebRTC to websocket.
|
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
|
### Usage
|
||||||
|
|
||||||
|
@ -15,10 +15,10 @@ There are currently two ways to try this:
|
||||||
- Through a browser snowflake proxy.
|
- Through a browser snowflake proxy.
|
||||||
|
|
||||||
Using the server plugin uses an HTTP server that simulates the interaction
|
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
|
Using the browser proxy (which will soon be the only way) requires copy and
|
||||||
pasting between 3 terminals and a browser tab.
|
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))
|
([issue #1](https://github.com/keroserene/snowflake/issues/1))
|
||||||
this will become much simpler to use.
|
this will become much simpler to use.
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@ $ torify ~/go_appengine/appcfg.py --no_cookies -A $YOUR_APP_ID update .
|
||||||
*/
|
*/
|
||||||
package snowflake_broker
|
package snowflake_broker
|
||||||
|
|
||||||
// host:port/basepath of the facilitator you want to register with
|
// host:port/basepath of the broker you want to register with
|
||||||
// for example, fp-facilitator.org or example.com:12345/facilitator
|
// for example, fp-broker.org or example.com:12345/broker
|
||||||
// https:// and /reg/ will be prepended and appended respectively.
|
// https:// and /reg/ will be prepended and appended respectively.
|
||||||
const SNOWFLAKE_FACILITATOR = ""
|
const SNOWFLAKE_BROKER = ""
|
||||||
|
|
|
@ -51,7 +51,7 @@ func regHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
// TODO: Get browser snowflake to talkto this appengine instance
|
// TODO: Get browser snowflake to talkto this appengine instance
|
||||||
// so it can reply with an answer, and not just the offer again :)
|
// 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)
|
w.Write(body)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ func init() {
|
||||||
http.HandleFunc("/robots.txt", robotsTxtHandler)
|
http.HandleFunc("/robots.txt", robotsTxtHandler)
|
||||||
http.HandleFunc("/ip", ipHandler)
|
http.HandleFunc("/ip", ipHandler)
|
||||||
http.HandleFunc("/reg/", regHandler)
|
http.HandleFunc("/reg/", regHandler)
|
||||||
// if SNOWFLAKE_FACILITATOR == "" {
|
// if SNOWFLAKE_BROKER == "" {
|
||||||
// panic("SNOWFLAKE_FACILITATOR empty; did you forget to edit config.go?")
|
// panic("SNOWFLAKE_BROKER empty; did you forget to edit config.go?")
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
|
@ -77,7 +77,7 @@ class Snowflake
|
||||||
@rateLimit = new BucketRateLimit(rateLimitBytes * RATE_LIMIT_HISTORY,
|
@rateLimit = new BucketRateLimit(rateLimitBytes * RATE_LIMIT_HISTORY,
|
||||||
RATE_LIMIT_HISTORY)
|
RATE_LIMIT_HISTORY)
|
||||||
|
|
||||||
# TODO: Should fetch from facilitator later.
|
# TODO: Should fetch from broker later.
|
||||||
setRelayAddr: (relayAddr) ->
|
setRelayAddr: (relayAddr) ->
|
||||||
addr = Parse.address relayAddr
|
addr = Parse.address relayAddr
|
||||||
if !addr
|
if !addr
|
||||||
|
@ -116,10 +116,10 @@ class Snowflake
|
||||||
promise = @proxyPair.pc.createAnswer next
|
promise = @proxyPair.pc.createAnswer next
|
||||||
promise.then next if promise
|
promise.then next if promise
|
||||||
|
|
||||||
# Poll facilitator when this snowflake can support more clients.
|
# Poll broker when this snowflake can support more clients.
|
||||||
proxyMain: ->
|
proxyMain: ->
|
||||||
if @proxyPairs.length >= MAX_NUM_CLIENTS * CONNECTIONS_PER_CLIENT
|
if @proxyPairs.length >= MAX_NUM_CLIENTS * CONNECTIONS_PER_CLIENT
|
||||||
setTimeout(@proxyMain, @facilitator_poll_interval * 1000)
|
setTimeout(@proxyMain, @broker_poll_interval * 1000)
|
||||||
return
|
return
|
||||||
params = [['r', '1']]
|
params = [['r', '1']]
|
||||||
params.push ['transport', 'websocket']
|
params.push ['transport', 'websocket']
|
||||||
|
@ -185,7 +185,7 @@ Interface =
|
||||||
$input.focus()
|
$input.focus()
|
||||||
|
|
||||||
# Signalling channel - just tells user to copy paste to the peer.
|
# 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 =
|
Signalling =
|
||||||
send: (msg) ->
|
send: (msg) ->
|
||||||
log '---- Please copy the below to peer ----\n'
|
log '---- Please copy the below to peer ----\n'
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// An HTTP-based signaling channel for the WebRTC server. It imitates the
|
// 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
|
// intermediate WebRTC proxy, rather connects them directly to this WebRTC
|
||||||
// server. This code should be deleted when we have proxies in place.
|
// server. This code should be deleted when we have proxies in place.
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue