Commit graph

832 commits

Author SHA1 Message Date
David Fifield
9ab8ea3df4 Use %.f not %.g to format stats interval.
fmt.Sprintf("%.g", 86400.4) → "9e+04"
fmt.Sprintf("%.f", 86400.4) → "86400"
2017-10-20 12:26:44 -07:00
David Fifield
085f253757 Fix periodic stats reporting.
The time interval was being reset every time a new connection came in.
2017-10-19 00:00:26 -07:00
Arlo Breault
99604ff15a Downgrade coffeelint line lengths to a "warning" 2017-10-18 11:39:17 -04:00
Arlo Breault
da8b37e866 Fix go vet complaint
"net.IPAddr composite literal uses unkeyed fields"
2017-10-18 11:34:00 -04: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
David Fifield
58556dc07b Keep track of clientAddr in statsChannel. 2017-10-17 22:19:43 -07:00
David Fifield
4697746120 Actually call clientAddr. 2017-10-17 22:19:23 -07:00
David Fifield
1ef6211c6c Rough tests for the clientAddr function. 2017-10-17 22:13:56 -07:00
David Fifield
d9e8f8f647 Log once a day how many connections had client_ip.
This is a sanity check against any catastrophic failure of our parsing
code.
2017-10-17 22:12:21 -07:00
David Fifield
c84e1a2e03 Add a dummy port number to USERADDR.
Current versions of tor accept USERADDR with or without a port number,
but future versions may become more strict and require the port number.
https://bugs.torproject.org/23080
2017-10-17 22:12:21 -07:00
David Fifield
83f8712078 Factor out a function to extract the client IP address. 2017-10-17 22:12:21 -07:00
David Fifield
9e5eb7f5ee Pass the incoming client_ip into the ExtORPort. 2017-10-14 15:06:36 -04:00
David Fifield
eca7ebb265 Bug 18628: Pass the client_ip parameter in the JavaScript proxy as well. 2017-10-14 15:06:36 -04:00
David Fifield
0c7ddeb1d0 Parse.ipFromSDP function. 2017-10-14 15:06:36 -04:00
Hooman
ae0643320e Pass client IP from proxy-go to server by parsing SDP
Call conn.RemoteAddr() before entering the datachannelHandler goroutine.
This is a workaround for the hang described at
https://bugs.torproject.org/18628#comment:8
2017-10-14 15:06:33 -04:00
Arlo Breault
82d7f16bab Use the "context" package in go 1.7
* Since we're now assuming >= 1.8.3
2017-10-12 18:39:03 -04:00
Arlo Breault
13b31f6494 Bump go version on travis to 1.8.3
* Same as currently used in TB,
   https://gitweb.torproject.org/builders/tor-browser-build.git/tree/projects/go/config?id=8c4c05ddcfc30107b967b204d491523685460226

 * Also, necessary for the "context" import in acme/autocert
2017-10-12 18:34:46 -04:00
Arlo Breault
fea9df7540 Use context.WithTimeout instead of transport.Deadline
* The field was removed in,
   11ed51af43
2017-10-12 18:20:33 -04:00
Arlo Breault
ab4bd77cb4 Go get another missing dep in travis 2017-10-12 17:32:47 -04:00
Arlo Breault
3b9a4624bd Add missing import removed in 0c02af3 2017-10-12 17:26:32 -04:00
Arlo Breault
66509e6af3 Go get missing dep in travis 2017-10-12 17:24:30 -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
Arlo Breault
fd217ffaab Updating from legacy (import "appengine") packages
* Ran, `go get google.golang.org/appengine/cmd/aefix`
   from https://github.com/golang/appengine
2017-10-12 17:15:08 -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
8dcd337ce4 Re-remove ipHandler function.
Had been removed in 2a46db2c01 and was
erroneously restored in the merge
36debdfdd2.
2017-08-11 13:08:36 -07:00
David Fifield
36debdfdd2 Merge branch 'standalone-broker' 2017-08-02 19:34:00 -07:00
David Fifield
3e3e4b8dd9 Deglobalize some flag-controlled variables.
Remove global opt struct.
2017-08-01 15:53:36 -07:00
David Fifield
1eb5c66428 Stop writing to global opt.brokerURL variable.
This variable was being written to by multiple goroutines, overwriting
the Path to either "/proxy" or "/answer" as necessary, which was racy.
2017-08-01 15:51:34 -07:00
David Fifield
461dbeba80 Make capacity a uint.
This prohibits some nonsense like "./proxy-go -capacity -550", which
otherwise results in a panic like:

INFO: configuration.go:174: Created Configuration at  &{[{[stun:stun.l.google.com:19302]  }] All Balanced }
panic: makechan: size out of range
2017-08-01 15:06:53 -07:00
David Fifield
dbe1ef4fa5 Remove unused stunURL and relayURL, unused except for parsing tests. 2017-08-01 10:55:14 -07:00
David Fifield
5440a4ba16 fmt 2017-07-25 18:59:15 -07:00
David Fifield
db2251345d Close the log file in server. 2017-07-16 15:03:56 -07:00
David Fifield
9ebde38b3f Add a -log option to server-webrtc. 2017-07-16 15:02:41 -07:00
David Fifield
86a244c39e Make client and server-webrtc log in UTC. 2017-07-16 14:58:34 -07:00
David Fifield
0ccb4b7cc8 Have embed.html refresh itself once a day.
This is a hedge against any bugs that may cause the badge to hang when
left running for a long time, and it also means that badges will
effectively check for updated code once a day.
2017-07-15 14:38:01 -07:00
David Fifield
2a46db2c01 Remove broker /ip endpoint.
Doesn't seem to be used anywhere; may have been inherited from flash
proxy.
2017-07-15 14:34:18 -07:00
David Fifield
827972e2bf Customize reflect.go for Snowflake broker.
Don't need Meek-IP.
2017-07-15 14:33:00 -07:00
David Fifield
a150a991d0 Copy appengine directory from meek commit 6057a9e9d6. 2017-07-15 13:45:26 -07:00
David Fifield
afe7716903 Replace --webPort and --tlsPort with a single --addr option. 2017-07-14 20:33:42 -07:00
David Fifield
2d89aa0b7b autocert (Let's Encrypt) for broker.
Replaces --cert and --key with --acme-hostnames and --acme-email.
2017-07-14 20:33:30 -07:00
David Fifield
2242be7a55 Have the broker log in UTC. 2017-07-14 20:07:50 -07:00
David Fifield
1966612113 go fmt 2017-07-14 20:06:00 -07:00
David Fifield
eaa82b8f9a Move flag code out of init into main. 2017-07-14 20:00:25 -07:00
David Fifield
f2ee53e42e Use https links for keroserene.net. 2017-07-14 18:36:44 -07:00
Hooman
3f4f5d2292 Server ports as parameters 2017-07-12 12:07:28 -07:00
Hooman
edbe18d411 Fixed README.md and added cert and key options 2017-07-11 13:33:00 -07:00
David Fifield
bfea72b50e Have proxy-go log in UTC. 2017-06-29 16:44:17 -07:00
David Fifield
b0dbf47473 Move some default config into constants at the stop. 2017-06-29 16:11:03 -07:00
David Fifield
c2c1a9d09d Enable proxy-go to create its log file. 2017-06-29 16:09:25 -07:00