Skip to content
Commits on Source (6)
== v1.5.0
Added the ReportVersion function that lets a client or server report its
implementation version using the new STATUS TYPE=version feature.
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/goptlib/-/issues/1
== v1.4.0
Moved the repository URL from git.torproject.org/pluggable-transports/goptlib.git
......
......@@ -80,6 +80,8 @@ func main() {
os.Exit(1)
}
pt.ReportVersion("dummy-client", "0.1")
if ptInfo.ProxyURL != nil {
pt.ProxyError("proxy is not supported")
os.Exit(1)
......
......@@ -77,6 +77,8 @@ func main() {
os.Exit(1)
}
pt.ReportVersion("dummy-server", "0.1")
listeners := make([]net.Listener, 0)
for _, bindaddr := range ptInfo.Bindaddrs {
switch bindaddr.MethodName {
......
......@@ -36,6 +36,7 @@
// ...
// func main() {
// var err error
// pt.ReportVersion("program", "v1.0")
// ptInfo, err = pt.ClientSetup(nil)
// if err != nil {
// os.Exit(1)
......@@ -94,6 +95,7 @@
// ...
// func main() {
// var err error
// pt.ReportVersion("program", "v1.0")
// ptInfo, err = pt.ServerSetup(nil)
// if err != nil {
// os.Exit(1)
......@@ -343,6 +345,15 @@ func ProxyDone() {
fmt.Fprintf(Stdout, "PROXY DONE\n")
}
// Report this program's name and version number using a STATUS TYPE=version
// line. Can be called any time before calling CmethodsDone or SmethodsDone.
//
// When called in a pluggable transport server, the implementation name and
// version number will appear in the relay's bridge-extra-info descriptor.
func ReportVersion(implementation string, version string) {
line("STATUS", "TYPE=version", "IMPLEMENTATION="+encodeCString(implementation), "VERSION="+encodeCString(version))
}
// Unexported type to represent log severities, preventing external callers from
// inventing new severity strings that may violate quoting rules.
//
......