mirror of https://github.com/cbeuw/Cloak
Merge branch 'master' of https://github.com/cbeuw/Cloak
This commit is contained in:
commit
75ab568cda
|
|
@ -73,7 +73,7 @@ Then run `make client` or `make server`. Output binary will be in `build` folder
|
||||||
## Setup
|
## Setup
|
||||||
### For the administrator of the server
|
### For the administrator of the server
|
||||||
|
|
||||||
0. Set up the underlying proxy server. Note that if you are using OpenVPN, you must change the protocol to TCP as Cloak does not support UDP
|
0. Set up the underlying proxy server.
|
||||||
1. Download [the latest release](https://github.com/cbeuw/Cloak/releases) or clone and build this repo.
|
1. Download [the latest release](https://github.com/cbeuw/Cloak/releases) or clone and build this repo.
|
||||||
2. Run ck-server -k. The base64 string before the comma is the **public** key to be given to users, the one after the comma is the **private** key to be kept secret
|
2. Run ck-server -k. The base64 string before the comma is the **public** key to be given to users, the one after the comma is the **private** key to be kept secret
|
||||||
3. Run `ck-server -u`. This will be used as the AdminUID
|
3. Run `ck-server -u`. This will be used as the AdminUID
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"errors"
|
"errors"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
|
@ -23,6 +24,7 @@ type rawConfig struct {
|
||||||
Transport string
|
Transport string
|
||||||
NumConn int
|
NumConn int
|
||||||
StreamTimeout int
|
StreamTimeout int
|
||||||
|
RemotePort int
|
||||||
}
|
}
|
||||||
|
|
||||||
// State stores the parsed configuration fields
|
// State stores the parsed configuration fields
|
||||||
|
|
@ -142,5 +144,15 @@ func (sta *State) ParseConfig(conf string) (err error) {
|
||||||
}
|
}
|
||||||
sta.staticPub = pub
|
sta.staticPub = pub
|
||||||
|
|
||||||
|
// OPTIONAL: set RemotePort via JSON
|
||||||
|
// if RemotePort is specified in the JSON we overwrite sta.RemotePort
|
||||||
|
// if not, don't do anything, since sta.RemotePort is already initialised in ck-client.go
|
||||||
|
if preParse.RemotePort != 0 {
|
||||||
|
// basic validity check
|
||||||
|
if preParse.RemotePort >= 1 && preParse.RemotePort <= 65535 {
|
||||||
|
sta.RemotePort = strconv.Itoa(preParse.RemotePort)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue