Commit graph

66 commits

Author SHA1 Message Date
Arlo Breault
8a31312ca1 Provide a flag to Log to state dir 2018-03-13 15:00:58 -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
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
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
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
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
Serene Han
b2d7586cb4 use webrtcRemotes len for capacity instead of the chan 2016-03-27 09:08:54 -07:00
Serene Han
22ace32a71 replace webrtcRemote with webrtcRemotes map & indexing, client multiplexing remotes confirmed working (#31) 2016-03-27 09:08:54 -07:00
Serene Han
a8ea5e586e client multiplexing using a webRTCConn channel (#31) 2016-03-27 09:08:54 -07:00
Serene Han
451edb6dec begin multiplex snowflake connect loop for #31 2016-03-27 09:08:54 -07:00
Arlo Breault
ed60c74686 Redundant close 2016-03-20 08:48:49 -07:00
Serene Han
b8815627bd defer conn.Close for simplicity and remove unnecessary goroutines, improve error handling (close #12) 2016-03-19 22:36:17 -07:00
Arlo Breault
598e2a3bfb Close SocksConn when WebRTC connection is reset
* This will induce the tor client to establish a new SocksConn,
   which in turn will dial a new WebRTC connection.

   To be improved upon.

 * Part of #12
2016-03-18 21:29:31 -07:00
Serene Han
960a136c64 retry client offers immediately instead of reset, combine sendOffer and receiveAnswer into exchangeSDP 2016-03-08 20:33:39 -08:00
Serene Han
9daa6c4b71 multiple arbitrary ice servers can be passed as client flag (close #24) 2016-03-05 17:01:33 -08:00
Serene Han
4e6bba559a provide IceServerList flag as variadic arg to webrtc Configuration (#24) 2016-03-04 13:21:56 -08:00
Serene Han
3ec771df01 prepare IceServerList client flag (#24) 2016-03-03 22:51:10 -08:00
Serene Han
5edac195f6 move endWebRTC() mostly into webRTCConn.Close() 2016-02-26 14:35:20 -08:00
Serene Han
f3e0abe0e1 only flush datachannel with nonzero bytes, which prevents Tor from marking the SOCKS for close (#12) 2016-02-25 01:24:06 -08:00
Serene Han
d4efe774d1 remove webRTCConn SendLoop and simplify Write without additional channel, as net.Conn is already safe 2016-02-23 17:34:51 -08:00
Serene Han
3a7e0ea620 simplify client handler & dialWebRTC with independent webRTCConn constructor 2016-02-23 17:01:44 -08:00
Serene Han
f86f5b5b07 move webRTCConn into separate file 2016-02-21 22:03:19 -08:00
Serene Han
ef5cb162c0 fix SendData channel syncing 2016-02-21 22:00:51 -08:00
Serene Han
c3ada1b545 Use a channel to safely synchronize datachannel writes, (#12)
clean up ice candidate log message.
still need to debug the copy loop break.
2016-02-19 16:25:08 -08:00
Serene Han
c4215b5614 log traffic bytes only once every few seconds, along with OnMessage & datachannel.Send counts, to prevent flooded logs 2016-02-18 14:15:22 -08:00
Serene Han
a1b7e01c54 Include answer channel as part of the webRTCConn struct (#12) 2016-02-17 20:41:33 -08:00
Serene Han
8a2e7a6041 Use reconnect timeout on client (#12) 2016-02-17 19:53:11 -08:00
Serene Han
f205a0be59 Snowflake client now using a reconnect loop (#12) 2016-02-17 19:19:16 -08:00
Serene Han
eb7eb04ac0 Buffer writes to DataChannel, remove blocking on openChannel (#12) 2016-02-17 18:38:52 -08:00
Serene Han
760dee8a0f prepare snowflake client for buffered datachannel writes, separate out dialWebRTC (#12) 2016-02-17 17:42:00 -08:00
Arlo Breault
9fd471b4c4 Update to go-webrtc HEAD 2016-02-15 12:37:52 -08:00