Skip to content

Commit

Permalink
modify readme
Browse files Browse the repository at this point in the history
  • Loading branch information
ls0f committed Aug 3, 2017
1 parent b41ad74 commit 956e8fa
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ go get github.com/lovedboy/cracker/local
## Server side (Run on your vps or other application container platform)

```
./server -addr :8080 -secret <password>
./server -addr :8080 -secret <password> -logtostderr
```

## Local side (Run on your local pc)

```
./local -raddr http://example.com:8080 -secret <password>
./local -raddr http://example.com:8080 -secret <password> -logtostderr
```

## https
Expand All @@ -50,11 +50,11 @@ It is strongly recommended to open the https option on the server side.
If you have a ssl certificate, It would be easy.

```
./server -addr :443 -secret <password> -https -cert /etc/cert.pem -key /etc/key.pem
./server -addr :443 -secret <password> -https -cert /etc/cert.pem -key /etc/key.pem -logtostderr
```

```
./local -raddr https://example.com -secret <password>
./local -raddr https://example.com -secret <password> -logtostderr
```

Of Course, you can create a self-signed ssl certificate by openssl.
Expand All @@ -64,11 +64,11 @@ sh -c "$(curl https://raw.githubusercontent.com/lovedboy/cracker/master/gen_key_
```

```
./server -addr :443 -secret <password> -https -cert /etc/self-signed-cert.pem -key /etc/self-ca-key.pem
./server -addr :443 -secret <password> -https -cert /etc/self-signed-cert.pem -key /etc/self-ca-key.pem -logtostderr
```

```
./local -raddr https://example.com -secret <password> -cert /etc/self-signed-cert.pem
./local -raddr https://example.com -secret <password> -cert /etc/self-signed-cert.pem -logtostderr
```


Expand All @@ -77,7 +77,7 @@ sh -c "$(curl https://raw.githubusercontent.com/lovedboy/cracker/master/gen_key_
If you don't want to run the server side, I did for you :) you only need to run the local side.

```
./local -raddr https://lit-citadel-13724.herokuapp.com -secret 123456
./local -raddr https://lit-citadel-13724.herokuapp.com -secret 123456 -logtostderr
```

[Deploy the server side on heroku](https://github.com/lovedboy/cracker-heroku)
Expand Down
5 changes: 4 additions & 1 deletion cmd/local/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"
"os"

g "github.com/golang/glog"
"github.com/ls0f/cracker"
p "github.com/ls0f/proxylib"
)
Expand All @@ -23,6 +24,8 @@ func main() {
cert := flag.String("cert", "", "cert file")
flag.Parse()

defer g.Flush()

if *version {
fmt.Printf("GitTag: %s \n", GitTag)
fmt.Printf("BuildTime: %s \n", BuildTime)
Expand All @@ -39,5 +42,5 @@ func main() {
}
s.HTTPHandler = handler
s.Socks5Handler = handler
s.ListenAndServe()
g.Fatal(s.ListenAndServe())
}
1 change: 1 addition & 0 deletions cmd/server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ func main() {
fmt.Printf("BuildTime: %s \n", BuildTime)
os.Exit(0)
}
defer g.Flush()
p := cracker.NewHttpProxy(*addr, *secret, *https)
if *https {
f, err := os.Stat(*cert)
Expand Down

0 comments on commit 956e8fa

Please sign in to comment.