- Aug 05, 2021
-
-
David Fifield authored
-
David Fifield authored
-
David Fifield authored
-
David Fifield authored
-
David Fifield authored
-
David Fifield authored
Currently the same as httpRendezvous, but activated using the -ampcache command-line option.
-
David Fifield authored
This package contains a CacheURL function that modifies a URL to be accessed through an AMP cache, and the "AMP armor" data encoding scheme for encoding data into the AMP subset of HTML.
-
David Fifield authored
Makes BrokerChannel abstract over a rendezvousMethod. BrokerChannel itself is responsible for keepLocalAddresses and the NAT type state, as well as encoding and decoding client poll messages. rendezvousMethod is only responsible for delivery of encoded messages.
-
David Fifield authored
Formerly, BrokerChannel represented the broker URL and possible domain fronting as bc.url *url.URL bc.Host string That is, bc.url is the URL of the server which we contact directly, and bc.Host is the Host header to use in the request. With no domain fronting, bc.url points directly at the broker itself, and bc.Host is blank. With domain fronting, we do the following reshuffling: if front != "" { bc.Host = bc.url.Host bc.url.Host = front } That is, we alter bc.url to reflect that the server to which we send requests directly is the CDN, not the broker, and store the broker's own URL in the HTTP Host header. The above representation was always confusing to me, because in my mental model, we are always conceptually communicating with the broker; but we may optionally be using a CDN proxy in the middle. The new representation is bc.url *url.URL bc.front string bc.url is the URL of the broker itself, and never changes. bc.front is the optional CDN front domain, and likewise never changes after initialization. When domain fronting is in use, we do the swap in the http.Request struct, not in BrokerChannel itself: if bc.front != "" { request.Host = request.URL.Host request.URL.Host = bc.front } Compare to the representation in meek-client: https://gitweb.torproject.org/pluggable-transports/meek.git/tree/meek-client/meek-client.go?h=v0.35.0#n94 var options struct { URL string Front string } https://gitweb.torproject.org/pluggable-transports/meek.git/tree/meek-client/meek-client.go?h=v0.35.0#n308 if ok { // if front is set info.Host = info.URL.Host info.URL.Host = front }
-
David Fifield authored
The tests were using a broker URL of "test.broker" (i.e., a schema-less, host-less, relative path), and running assertions on the value of b.url.Path. This is strange, especially in tests regarding domain fronting, where we care about b.url.Host, not b.url.Path. This commit changes the broker URL to "http://test.broker" and changes tests to check b.url.Host. I also added an additional assertion for an empty b.Host in the non-domain-fronted case.
-
- Jul 21, 2021
-
-
meskio authored
Simplify the code to use a ticker. Using a pattern to allow a first run of the loop before hitting the ticker: https://github.com/golang/go/issues/17601#issuecomment-311955879
- Jul 19, 2021
-
-
Cecylia Bocovich authored
-
Cecylia Bocovich authored
-
- Jul 18, 2021
-
-
David Fifield authored
Instead of copying the value.
-
David Fifield authored
Unused since 1364d7d4.
-
- Jul 13, 2021
-
- Jul 08, 2021
-
-
Arlo Breault authored
-
Arlo Breault authored
-
Arlo Breault authored
The legacy code does case matching on these exact strings so it's better to ensure they're constant.
-
Arlo Breault authored
Move the logic for the legacy version into the http handlers and use a shim when doing ipc.
-
-
Arlo Breault authored
Introduces an IPC struct and moves the logic out of the http handlers and into methods on that.
-
- Jul 07, 2021
-
-
meskio authored
So the assignment of proxies is based on the load. The number of clients is ronded down to 8. Existing proxies that doesn't report the number of clients will be distributed equaly to new proxies until they get 8 clients, that is okish as the existing proxies do have a maximum capacity of 10. Fixes #40048
- Jun 24, 2021
-
-
Cecylia Bocovich authored
Remove the -max 3 option because we only use one snowflake. Add SocksPort auto because many testers have a tor process already bound to port 9050.
-
Cecylia Bocovich authored
Refactor out a separate handleStream function and ensure that all connections are closed and the references are out of scope.
-
Cecylia Bocovich authored
-
Cecylia Bocovich authored
We used a WaitGroup to prevent a call to Peers.End from melting snowflakes while a new one is being collected. However, calls to WaitGroup.Add are in a race with WaitGroup.Wait. To fix this, we use a Mutex instead.
-
Cecylia Bocovich authored
-
Cecylia Bocovich authored
Using the boolean value was unnecessary since we already have a channel we can check for closure.
-
Cecylia Bocovich authored
The race condition occurs because concurrent goroutines are intermixing reads and writes of `WebRTCPeer.closed`. Spotted when integrating Snowflake inside OONI in https://github.com/ooni/probe-cli/pull/373.
-
The race condition occurs because concurrent goroutines are intermixing reads and writes of `WebRTCPeer.lastReceive`. Spotted when integrating Snowflake inside OONI in https://github.com/ooni/probe-cli/pull/373.
-
- Jun 23, 2021
-
-
Cecylia Bocovich authored
-
- Jun 19, 2021
-
-
Cecylia Bocovich authored
This fixes a stats collection bug where we were converting client addresses between a string and net.Addr using the clientAddr function multiple times, resulting in an empty string for all addresses.
-
- Jun 14, 2021
-
-
sbs authored
In VSCode, the staticcheck tool emits this warning: > should call wg.Add(1) before starting the goroutine to > avoid a race (SA2000)go-staticcheck To avoid this warning, just move wg.Add outside.
-
- Jun 07, 2021
-
- Jun 02, 2021
-
-
Cecylia Bocovich authored
Send the client poll request and response in a json-encoded format in the HTTP request body rather than sending the data in HTTP headers. This will pave the way for using domain-fronting alternatives for the Snowflake rendezvous.
- May 24, 2021
-
-
David Fifield authored
Make a stack of cleanup functions to run (as with defer), but clear the stack before returning if no error occurs. Uselessly pushing the stream.Close() cleanup just before clearing the stack is an intentional safeguard, for in case additional operations are added before the return in the future. Fixes #40042.
-