This is an automated email from the git hooks/post-receive script.
cohosh pushed a commit to branch main in repository pluggable-transports/snowflake-webext.
commit 1e132b7acd830f63351e58fc107f106589d1b0bd Author: WofWca wofwca@protonmail.com AuthorDate: Sun Nov 6 14:31:57 2022 +0400
refactor: format, add comments --- broker.js | 1 + snowflake.js | 3 +++ 2 files changed, 4 insertions(+)
diff --git a/broker.js b/broker.js index f9be89f..291a0ed 100644 --- a/broker.js +++ b/broker.js @@ -42,6 +42,7 @@ class Broker { * Registers this Snowflake with the broker using an HTTP POST request, and * waits for a response containing some client offer that the Broker chooses * for this proxy.. + * Rejects on timeout or on error. * TODO: Actually support multiple clients. */ getClientOffer(id, numClientsConnected) { diff --git a/snowflake.js b/snowflake.js index ae0a974..c62ee62 100644 --- a/snowflake.js +++ b/snowflake.js @@ -69,14 +69,17 @@ class Snowflake { pollBroker() { const pair = this.makeProxyPair(); log('Polling broker..'); + let msg = 'Polling for client ... '; if (this.retries > 0) { msg += '[retries: ' + this.retries + ']'; } this.ui.setStatus(msg); + //update NAT type console.log("NAT type: " + this.ui.natType); this.broker.setNATType(this.ui.natType); + const recv = this.broker.getClientOffer(pair.id, this.proxyPairs.length); recv.then((resp) => { const clientNAT = resp.NAT;