mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-14 05:11:19 -04:00
Update proxy config to take proxy type
This allows badge and standalone proxies to tell the broker what proxy type they are.
This commit is contained in:
parent
7277bb37cd
commit
8ab81fc6cd
7 changed files with 30 additions and 13 deletions
|
@ -14,11 +14,12 @@ class Broker {
|
|||
// ID so the Broker can keep track of each proxy's signalling channels.
|
||||
// On construction, this Broker object does not do anything until
|
||||
// |getClientOffer| is called.
|
||||
constructor(url) {
|
||||
constructor(config) {
|
||||
this.getClientOffer = this.getClientOffer.bind(this);
|
||||
this._postRequest = this._postRequest.bind(this);
|
||||
|
||||
this.url = url;
|
||||
this.config = config
|
||||
this.url = config.brokerUrl;
|
||||
this.clients = 0;
|
||||
if (0 === this.url.indexOf('localhost', 0)) {
|
||||
// Ensure url has the right protocol + trailing slash.
|
||||
|
@ -63,7 +64,7 @@ class Broker {
|
|||
}
|
||||
};
|
||||
this._xhr = xhr; // Used by spec to fake async Broker interaction
|
||||
var data = {"Version": "1.0", "Sid": id}
|
||||
var data = {"Version": "1.1", "Sid": id, "Type": this.config.proxyType}
|
||||
return this._postRequest(xhr, 'proxy', JSON.stringify(data));
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue