Commit graph

304 commits

Author SHA1 Message Date
Cecylia Bocovich
cd650fa009 Keyed composite literal to avoid go vet warning 2019-05-28 13:58:16 -04:00
Cecylia Bocovich
254e6b9a3d Simplified limitedReader by reading one extra byte 2019-05-28 13:29:59 -04:00
Cecylia Bocovich
0842dad38e Added tests to check large read guards 2019-05-28 13:29:59 -04:00
Cecylia Bocovich
1d76d3ca2e Implement limitedRead function for client side
MaxBytesReader is only documented for server side reads, so we're using
a local limitedRead function instead that uses an io.LimitedReader.

Declared limits in a commented constant
2019-05-28 13:29:59 -04:00
Cecylia Bocovich
ce3101d016 Guard against large reads
This is a fix for #26348
2019-05-28 13:29:59 -04:00
Arlo Breault
5380aaca8c Use OnIceGatheringStateChange instead of OnIceComplete in client
Amounts to the same thing as currently implemented in go-webrtc
2019-05-21 14:34:40 -04:00
Arlo Breault
622005c79e Remove copy/paste signalling 2019-05-08 11:21:56 -04:00
Cecylia Bocovich
b4a4a256db Ported log sanitization to client 2019-04-12 09:52:23 -04:00
Cecylia Bocovich
3eb9064438 Removed unecessary output from logs
Removed raw bytes of ICE answers from broker logs and the SDP stanzas
from the client logs
2019-03-25 15:15:22 -04:00
David Fifield
a554439370 Link to #26360 for why we blackhole logs without -log.
Maybe we'll able to remove this in the far future.
2018-12-18 21:24:32 -07:00
Arlo Breault
cce7ee64a7 Start refactoring out a client and library 2018-11-20 22:38:02 -05:00
David Fifield
6077141f4a Log to io.Discard if no log file is set.
https://bugs.torproject.org/25600#comment:14

Snowflake in Tor Browser has been hanging after surfing for a while.
(Tor reports "no running bridges".) It only began happening after commit
12922a232b, which caused snowflake-client not to log to a file by
default (leaving it to log to its default stderr). What seems to be
happening is that tor doesn't read from its PT clients' stderr, leaving
a buffer to fill up that eventually causes a hang.
2018-06-10 16:41:32 -07:00
David Fifield
88ea7a5083 Switch to an Azure domain front.
https://bugs.torproject.org/22782
2018-04-30 09:52:38 -07:00
David Fifield
947636ae81 Change to standalone broker.
https://snowflake-reg-test.appspot.com/ for the client (needs domain fronting)
https://snowflake-broker.bamsoftware.com/ for the proxies (no fronting)

Note that fronting to App Engine doesn't currently actually work because
of https://bugs.torproject.org/25804; this commit doesn't change that.
2018-04-16 10:24:00 -07:00
David Fifield
bdc1798adb Exit immediately after SIGTERM is there are no signals running.
Cf. https://bugs.torproject.org/24875
2018-03-21 00:51:04 -07:00
David Fifield
6a9c2bf951 Don't log "SOCKS accepted" if there was an Accept error.
This actually caused a nil pointer dereference panic when Accept
returned an error, because conn was nil.
2018-03-21 00:43:17 -07:00
Arlo Breault
1114acbcb4 Add synchronization around destroying DataChannels and PeerConnections
From https://trac.torproject.org/projects/tor/ticket/21312#comment:33
2018-03-20 15:08:36 -04:00
David Fifield
c61336c897 Use ResolveReference to construct the /client URL.
This way works when the base URL lacks a path, e.g.
"http://127.0.0.1:8080".
https://bugs.torproject.org/25472
2018-03-13 15:37:50 -04:00
Arlo Breault
8a31312ca1 Provide a flag to Log to state dir 2018-03-13 15:00:58 -04:00
Arlo Breault
f6301197cc Call explicit frees in client 2018-03-05 18:59:08 -05:00
Arlo Breault
def423f5c6 torrc-manuel deserves a -log 2017-10-18 11:21:57 -04:00
Arlo Breault
bbb5a6aca2 webrtc.NewIceServer already does this split / validation
It also expects to be called with a non-empty string, which isn't
the case with this Split which always envokes the loop at least
once.  If -ice was omitted, an error was logged.
2017-10-18 11:15:53 -04:00
Arlo Breault
3b9a4624bd Add missing import removed in 0c02af3 2017-10-12 17:26:32 -04:00
Arlo Breault
441cd8c80f Update for the latest go-webrtc
* From https://github.com/keroserene/go-webrtc/pull/59
2017-10-12 17:17:57 -04:00
David Fifield
0c02af35d0 Move handling of -ice option into main.
Rather than having it happen as a side effect of flag parsing.

Having it happen as a side effect of flag parsing caused log messages
related to handling the option (e.g. "IceServerList:") to always go to
stderr, despite the presence of a -log option. This is because the
requested log file had not been opened yet.
2017-08-14 12:33:28 -07:00
David Fifield
86a244c39e Make client and server-webrtc log in UTC. 2017-07-16 14:58:34 -07:00
David Fifield
12922a232b Make logging optional and controlled by a -log option. 2017-06-29 15:46:57 -07:00
David Fifield
f418ec7a85 Handle TOR_PT_EXIT_ON_STDIN_CLOSE. 2017-06-29 15:28:27 -07:00
David Fifield
1fa9bc051c Remove SIGINT handling (no longer part of pt-spec). 2017-06-29 15:20:54 -07:00
Serene H
47e1338290 initial client roundtrip estimate on broker 2016-09-20 06:28:11 -07:00
Arlo Breault
6cecd31fd8 Log to TOR_PT_STATE_LOCATION 2016-08-21 18:32:02 -07:00
Serene H
ac9d49b872 ensure closing stale remotes from the client side 2016-08-01 12:17:28 -07:00
Serene H
ea2e052a7d defer snowflake.Reset to fix handler recovery when localhost SOCKS occassionally fails first 2016-07-29 10:59:51 -07:00
Serene Han
c1f623948b update README 2016-06-18 15:51:14 -07:00
Serene Han
e93c38f834 client multiplexes AND recovers correctly! (close #31)
- stabilize rest of WebRTCPeer
 - use uid for the datachannel label
 - store a consistent WebRTC config in the dialer
2016-06-15 21:57:56 -07:00
Serene Han
2bf0e5457e pull copyLoop out of goroutine, better pop and reset 2016-06-14 17:07:21 -07:00
Serene Han
a71c98c0ae able to break out of ConnectLoop, try separate webrtcConfigs as well 2016-06-13 15:12:47 -07:00
Serene Han
4ca0a3aa0a improve client interface specificity and composability which eliminates much unnecessary code 2016-06-13 11:10:49 -07:00
Serene Han
02562ba750 copy-paste rendezvous works again, but with new interface allowing seamless recovery for the first time 2016-06-12 12:43:24 -07:00
Serene Han
fedb124313 localize ptInfo and iceServers vars, separate copy-paste helpers, move some logging
to more sensible locations
2016-06-12 11:51:59 -07:00
Serene Han
b6f15a8d5c expose multiplex capacity as flag, un-global some more 2016-06-12 00:20:54 -07:00
Serene Han
2caa47988d fix Peers.Count() using activePeers list, mark for delete on Close, and remove
maxedChan
2016-06-11 23:59:26 -07:00
Serene Han
c63f5cfc0a Separate peers.go file with improved documentation and more solid interfaces 2016-06-11 19:58:08 -07:00
Serene Han
556596cc5a interfaces.go, SnowflakeCollector, better composition 2016-05-24 15:18:54 -07:00
Serene Han
b2c9fcac5e webRTCConn has better seam with BytesLogger interface 2016-05-24 12:56:09 -07:00
Serene Han
6b8568cc6c client interfaces compose better, remove some globals, test ConnectLoop 2016-05-19 19:44:54 -07:00
Serene Han
00196bbd74 more complete and improved client rendezvous tests 2016-05-18 13:21:01 -07:00
Serene Han
03b1a0d1f1 remove dead code 2016-04-05 10:29:17 -07:00
Serene Han
1d1882b59d webRTCConn close as part of its reset, instead of depending on external deferred close after receiving reset channel, allows valid disconnections even before use 2016-04-05 10:29:17 -07:00
Serene Han
bc1a499bc8 use only one BrokerChannel 2016-04-05 10:29:17 -07:00