Skip to content
Snippets Groups Projects
Commit 7f243f98 authored by Benjamin Erhart's avatar Benjamin Erhart
Browse files

Improved donated `SnowflakeVersion` code.

parent 8cbe72ec
Branches
No related tags found
1 merge request!2update to v 1.7.1
......@@ -99,22 +99,26 @@ func Obfs4ProxyVersion() string {
return obfs4proxy.Obfs4proxyVersion
}
// SnowflakeProxyVersion - The version of Snowflake bundled with IPtProxy
// SnowflakeVersion - The version of Snowflake bundled with IPtProxy.
//
//goland:noinspection GoUnusedExportedFunction
func SnowflakeProxyVersion() string {
func SnowflakeVersion() string {
bi, ok := debug.ReadBuildInfo()
if !ok {
log.Printf("Failed to read build info")
return ""
}
for _, dep := range bi.Deps {
if (dep.Path == "git.torproject.org/pluggable-transports/snowflake.git/v2") {
if dep.Path == "git.torproject.org/pluggable-transports/snowflake.git/v2" {
if dep.Version[0:1] == "v" {
return dep.Version[1:len(dep.Version)]
} else {
return dep.Version
}
}
}
return ""
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment