[tor-commits] [flashproxy/master] Add --port option to websocket-server.
dcf at torproject.org
dcf at torproject.org
Wed Jan 30 05:11:38 UTC 2013
commit a3edf9fd1d9e92120a84e5d8473c6e850afcd31f
Author: David Fifield <david at bamsoftware.com>
Date: Mon Nov 26 04:15:02 2012 -0800
Add --port option to websocket-server.
---
websocket-transport/websocket-server.go | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/websocket-transport/websocket-server.go b/websocket-transport/websocket-server.go
index 76c51d6..95fd0af 100644
--- a/websocket-transport/websocket-server.go
+++ b/websocket-transport/websocket-server.go
@@ -3,6 +3,7 @@ package main
import (
"encoding/base64"
"errors"
+ "flag"
"fmt"
"io"
"net"
@@ -13,7 +14,7 @@ import (
"time"
)
-const defaultPort = 9901
+var defaultPort int
var ptInfo ptServerInfo
@@ -184,6 +185,9 @@ func startListener(addr *net.TCPAddr) (*net.TCPListener, error) {
func main() {
const ptMethodName = "websocket"
+ flag.IntVar(&defaultPort, "port", 0, "port to listen on if unspecified by Tor")
+ flag.Parse()
+
ptInfo = ptServerSetup([]string{ptMethodName})
listeners := make([]*net.TCPListener, 0)
More information about the tor-commits
mailing list