Commit graph

12 commits

Author SHA1 Message Date
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
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
David Fifield
faeb8da8c9 Use crypto/rand, not math/rand, to generate session IDs.
math/rand always uses a deterministic seed. The sequence of session IDs
was therefore always the same:
	Uv38ByGCZU8WP18PmmIdcg
	lWbHTRDYaB0NhtHpHgAWeQ
	...

Multiple copies of this program would have had session ID collisions. I
don't know what the consequences of that would be.
2017-06-29 16:00:29 -07:00
David Fifield
af8a026991 Improve some error messages. 2017-06-29 15:59:07 -07:00
David Fifield
c3f87281be Add -log option to proxy-go. 2017-06-29 15:11:14 -07:00
David Fifield
62f50b29b2 Minimal README for proxy-go. 2017-05-04 01:19:42 -07:00
yinghuocho
4b5794c935 Golang implementation of standalone snowflake proxy 2017-04-24 16:16:02 -07:00