mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-13 20:11:19 -04:00
Add Version Output Support to Snowflake
From now on, there will be a file at common/version/version.go that includes current version number.
This commit is contained in:
parent
2c599f8827
commit
33248f3dec
8 changed files with 81 additions and 0 deletions
|
@ -2,6 +2,7 @@ package main
|
|||
|
||||
import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
|
@ -12,6 +13,7 @@ import (
|
|||
|
||||
"git.torproject.org/pluggable-transports/snowflake.git/v2/common/event"
|
||||
"git.torproject.org/pluggable-transports/snowflake.git/v2/common/safelog"
|
||||
"git.torproject.org/pluggable-transports/snowflake.git/v2/common/version"
|
||||
sf "git.torproject.org/pluggable-transports/snowflake.git/v2/proxy/lib"
|
||||
)
|
||||
|
||||
|
@ -31,11 +33,17 @@ func main() {
|
|||
"the time interval to output summary, 0s disables summaries. Valid time units are \"s\", \"m\", \"h\". ")
|
||||
verboseLogging := flag.Bool("verbose", false, "increase log verbosity")
|
||||
ephemeralPortsRangeFlag := flag.String("ephemeral-ports-range", "", "ICE UDP ephemeral ports range (format:\"<min>:<max>\")")
|
||||
versionFlag := flag.Bool("version", false, "display version info to stderr and quit")
|
||||
|
||||
var ephemeralPortsRange []uint16 = []uint16{0, 0}
|
||||
|
||||
flag.Parse()
|
||||
|
||||
if *versionFlag {
|
||||
fmt.Fprintf(os.Stderr, "snowflake-proxy %s", version.ConstructResult())
|
||||
os.Exit(0)
|
||||
}
|
||||
|
||||
eventLogger := event.NewSnowflakeEventDispatcher()
|
||||
|
||||
if *ephemeralPortsRangeFlag != "" {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue