commit c47f7674117b878e7f35b28e64698373f74974dd Author: David Fifield david@bamsoftware.com Date: Sun Dec 2 18:37:02 2012 -0800
I think --port should always override tor's requested port. --- websocket-transport/websocket-server.go | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/websocket-transport/websocket-server.go b/websocket-transport/websocket-server.go index ea13c1e..725053c 100644 --- a/websocket-transport/websocket-server.go +++ b/websocket-transport/websocket-server.go @@ -187,9 +187,10 @@ func main() {
listeners := make([]*net.TCPListener, 0) for _, bindAddr := range ptInfo.BindAddrs { - // When tor tells us a port of 0, we are supposed to pick a - // random port. But we actually want to use the configured port. - if bindAddr.Addr.Port == 0 { + // Override tor's requested port (which is 0 if this transport + // has not been run before) with the one requested by the --port + // option. + if defaultPort != 0 { bindAddr.Addr.Port = defaultPort }
tor-commits@lists.torproject.org