Skip to content

Commit

Permalink
Fix issue #16
Browse files Browse the repository at this point in the history
  • Loading branch information
kimw committed Apr 9, 2018
1 parent 27fac11 commit c7dd7a6
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
13 changes: 10 additions & 3 deletions cmd/gq-client/gq-client.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ package main

import (
"flag"
"github.com/cbeuw/GoQuiet/gqclient"
"github.com/cbeuw/GoQuiet/gqclient/TLS"
"github.com/cbeuw/gotfo"
"io"
"log"
"net"
"os"
"time"

"github.com/cbeuw/GoQuiet/gqclient"
"github.com/cbeuw/GoQuiet/gqclient/TLS"
"github.com/cbeuw/gotfo"
)

// ss refers to the ss-client, remote refers to the proxy server
Expand Down Expand Up @@ -164,13 +165,19 @@ func main() {
flag.StringVar(&remotePort, "p", "443", "remotePort: proxy port, should be 443")
flag.StringVar(&pluginOpts, "c", "gqclient.json", "configPath: path to gqclient.json")
askVersion := flag.Bool("v", false, "Print the version number")
printUsage := flag.Bool("h", false, "Print this message")
flag.Parse()

if *askVersion {
log.Println("gq-client version: " + version)
return
}

if *printUsage {
flag.Usage()
return
}

log.Printf("Starting standalone mode. Listening for ss on %v:%v\n", localHost, localPort)
}

Expand Down
11 changes: 9 additions & 2 deletions cmd/gq-server/gq-server.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@ package main
import (
"errors"
"flag"
"github.com/cbeuw/GoQuiet/gqserver"
"github.com/cbeuw/gotfo"
"io"
"log"
"net"
"os"
"strings"
"time"

"github.com/cbeuw/GoQuiet/gqserver"
"github.com/cbeuw/gotfo"
)

type pipe interface {
Expand Down Expand Up @@ -221,13 +222,19 @@ func main() {
flag.StringVar(&remotePort, "p", "443", "remotePort: outbound listing port, should be 443")
flag.StringVar(&configPath, "c", "gqserver.json", "configPath: path to gqserver.json")
askVersion := flag.Bool("v", false, "Print the version number")
printUsage := flag.Bool("h", false, "Print this message")
flag.Parse()

if *askVersion {
log.Println("gq-server verison: " + version)
return
}

if *printUsage {
flag.Usage()
return
}

if *localAddr == "" {
log.Fatal("Must specify localAddr")
}
Expand Down

0 comments on commit c7dd7a6

Please sign in to comment.