[tor-commits] [flashproxy/master] Add PtServerInfo.ExtendedOrAddr.
dcf at torproject.org
dcf at torproject.org
Sun Feb 3 03:40:13 UTC 2013
commit 27e9950084de734ff979679393311f9dc9d7ada7
Author: David Fifield <david at bamsoftware.com>
Date: Mon Jan 28 22:13:17 2013 -0800
Add PtServerInfo.ExtendedOrAddr.
---
websocket-transport/pt.go | 13 +++++++++++--
1 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/websocket-transport/pt.go b/websocket-transport/pt.go
index 15848d1..ac5270e 100644
--- a/websocket-transport/pt.go
+++ b/websocket-transport/pt.go
@@ -262,8 +262,9 @@ func getServerBindAddrs(methodNames []string) []PtBindAddr {
// This structure is returned by PtServerSetup. It consists of a list of
// PtBindAddrs, along with a single address for the ORPort.
type PtServerInfo struct {
- BindAddrs []PtBindAddr
- OrAddr *net.TCPAddr
+ BindAddrs []PtBindAddr
+ OrAddr *net.TCPAddr
+ ExtendedOrAddr *net.TCPAddr
}
// Check the server pluggable transports environments, emitting an error message
@@ -293,5 +294,13 @@ func PtServerSetup(methodNames []string) PtServerInfo {
os.Exit(1)
}
+ var extendedOrPort = getenv("TOR_PT_EXTENDED_SERVER_PORT")
+ if extendedOrPort != "" {
+ info.ExtendedOrAddr, err = net.ResolveTCPAddr("tcp", extendedOrPort)
+ if err != nil {
+ PtEnvError(fmt.Sprintf("cannot resolve TOR_PT_EXTENDED_SERVER_PORT %q: %s", extendedOrPort, err.Error()))
+ }
+ }
+
return info
}
More information about the tor-commits
mailing list