mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-13 20:11:19 -04:00
Fixed README.md and added cert and key options
This commit is contained in:
parent
b7df69fa55
commit
edbe18d411
3 changed files with 19 additions and 28 deletions
|
@ -15,6 +15,7 @@ import (
|
|||
"time"
|
||||
"sync"
|
||||
"os"
|
||||
"flag"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -228,18 +229,27 @@ func ipHandler(w http.ResponseWriter, r *http.Request) {
|
|||
w.Write([]byte(remoteAddr))
|
||||
}
|
||||
|
||||
func main() {
|
||||
var cert, cert_key string
|
||||
|
||||
if len(os.Args) < 3 {
|
||||
log.Println("Usage: broker cert cert_key")
|
||||
func init() {
|
||||
flag.StringVar(&cert, "cert", "", "TLS certificate file")
|
||||
flag.StringVar(&cert_key, "key", "", "TLS key file")
|
||||
|
||||
flag.Parse()
|
||||
|
||||
|
||||
if cert == "" || cert_key == "" {
|
||||
log.Println("Missing options, exiting.")
|
||||
fmt.Println("Usage:")
|
||||
flag.PrintDefaults()
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
cert := os.Args[1]
|
||||
log.Println("Using cert file:", cert)
|
||||
cert_key := os.Args[2]
|
||||
log.Println("Using cert key file: ", cert_key)
|
||||
}
|
||||
|
||||
func main() {
|
||||
|
||||
ctx := NewBrokerContext()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue