diff --git a/IPtProxy.go/IPtProxy.go b/IPtProxy.go/IPtProxy.go index 5554d3d55186d61ca90b3570af540b94b7fd21c6..459320cc74223947e5f0a3774edaa20260e5020e 100644 --- a/IPtProxy.go/IPtProxy.go +++ b/IPtProxy.go/IPtProxy.go @@ -91,8 +91,12 @@ func init() { StateLocation += "/pt_state" } -// Obfs4ProxyVersion - the version of obfs4Proxy bundled with IPtProxy -const Obfs4ProxyVersion = obfs4proxy.obfs4proxyVersion +// Obfs4ProxyVersion - The version of Obfs4Proxy bundled with IPtProxy. +// +//goland:noinspection GoUnusedExportedFunction +func Obfs4ProxyVersion() string { + return obfs4proxy.Obfs4proxyVersion +} // StartObfs4Proxy - Start the Obfs4Proxy. // diff --git a/obfs4.patch b/obfs4.patch index 01c63475cde4c6354a57cdbb8cd3c3d1d1f7eca5..1776f08c010dd12f68a8970344123160c88d28db 100644 --- a/obfs4.patch +++ b/obfs4.patch @@ -1,5 +1,5 @@ diff --git a/obfs4proxy/obfs4proxy.go b/obfs4proxy/obfs4proxy.go -index d92f5f5..df2584e 100644 +index d92f5f5..d849b80 100644 --- a/obfs4proxy/obfs4proxy.go +++ b/obfs4proxy/obfs4proxy.go @@ -27,10 +27,9 @@ @@ -22,7 +22,15 @@ index d92f5f5..df2584e 100644 "sync" "syscall" -@@ -58,7 +58,7 @@ const ( +@@ -51,6 +51,7 @@ import ( + + const ( + obfs4proxyVersion = "0.0.13" ++ Obfs4proxyVersion = obfs4proxyVersion + obfs4proxyLogFile = "obfs4proxy.log" + socksAddr = "127.0.0.1:0" + ) +@@ -58,7 +59,7 @@ const ( var stateDir string var termMon *termMonitor @@ -31,7 +39,7 @@ index d92f5f5..df2584e 100644 ptClientInfo, err := pt.ClientSetup(transports.Transports()) if err != nil { golog.Fatal(err) -@@ -85,7 +85,20 @@ func clientSetup() (launched bool, listeners []net.Listener) { +@@ -85,7 +86,20 @@ func clientSetup() (launched bool, listeners []net.Listener) { continue } @@ -53,7 +61,7 @@ index d92f5f5..df2584e 100644 if err != nil { _ = pt.CmethodError(name, err.Error()) continue -@@ -304,22 +317,16 @@ func getVersion() string { +@@ -304,22 +318,16 @@ func getVersion() string { return fmt.Sprintf("obfs4proxy-%s", obfs4proxyVersion) } @@ -82,7 +90,7 @@ index d92f5f5..df2584e 100644 if err := log.SetLogLevel(*logLevelStr); err != nil { golog.Fatalf("[ERROR]: %s - failed to set log level: %s", execName, err) } -@@ -338,8 +345,7 @@ func main() { +@@ -338,8 +346,7 @@ func main() { golog.Fatalf("[ERROR]: %s - failed to initialize logging", execName) } if err = transports.Init(); err != nil { @@ -92,7 +100,7 @@ index d92f5f5..df2584e 100644 } log.Noticef("%s - launched", getVersion()) -@@ -347,7 +353,7 @@ func main() { +@@ -347,7 +354,7 @@ func main() { // Do the managed pluggable transport protocol configuration. if isClient { log.Infof("%s - initializing client transport listeners", execName) @@ -101,7 +109,7 @@ index d92f5f5..df2584e 100644 } else { log.Infof("%s - initializing server transport listeners", execName) launched, ptListeners = serverSetup() -@@ -379,3 +385,11 @@ func main() { +@@ -379,3 +386,11 @@ func main() { } termMon.wait(true) }