mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-14 05:11:19 -04:00
Add toggle functionality to web extension
This commit is contained in:
parent
ead579a6e9
commit
799a13d385
5 changed files with 37 additions and 3 deletions
|
@ -4,6 +4,9 @@ Entry point.
|
|||
|
||||
debug = false
|
||||
snowflake = null
|
||||
config = null
|
||||
broker = null
|
||||
ui = null
|
||||
|
||||
# Log to both console and UI if applicable.
|
||||
# Requires that the snowflake and UI objects are hooked up in order to
|
||||
|
@ -21,8 +24,17 @@ init = () ->
|
|||
snowflake = new Snowflake config, ui, broker
|
||||
|
||||
log '== snowflake proxy =='
|
||||
|
||||
update = () ->
|
||||
if !ui.enabled
|
||||
# Do not activate the proxy if any number of conditions are true.
|
||||
snowflake.disable()
|
||||
log 'Currently not active.'
|
||||
return
|
||||
|
||||
# Otherwise, begin setting up WebRTC and acting as a proxy.
|
||||
dbg 'Contacting Broker at ' + broker.url
|
||||
log 'Starting snowflake'
|
||||
snowflake.setRelayAddr config.relayAddr
|
||||
snowflake.beginWebRTC()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue