|
|
@@ -64,8 +64,8 @@ func runAccess(cli *CLI) {
|
|
64
|
64
|
IPv4: runMakeAccessResponseURLs(ipv4, conf, cli),
|
|
65
|
65
|
IPv6: runMakeAccessResponseURLs(ipv6, conf, cli),
|
|
66
|
66
|
}
|
|
67
|
|
- resp.Secret.Base64 = conf.Secret.Base64()
|
|
68
|
|
- resp.Secret.Hex = conf.Secret.EE()
|
|
|
67
|
+ resp.Secret.Base64 = conf.Secret.Base64()
|
|
|
68
|
+ resp.Secret.Hex = conf.Secret.Hex()
|
|
69
|
69
|
|
|
70
|
70
|
encoder := json.NewEncoder(os.Stdout)
|
|
71
|
71
|
|
|
|
@@ -92,6 +92,10 @@ func runAccessGetIP(ntw *network.Network, protocol string) net.IP {
|
|
92
|
92
|
return nil
|
|
93
|
93
|
}
|
|
94
|
94
|
|
|
|
95
|
+ if resp.StatusCode != http.StatusOK {
|
|
|
96
|
+ return nil
|
|
|
97
|
+ }
|
|
|
98
|
+
|
|
95
|
99
|
defer exhaustResponse(resp)
|
|
96
|
100
|
|
|
97
|
101
|
data, err := ioutil.ReadAll(resp.Body)
|
|
|
@@ -111,10 +115,11 @@ func runMakeAccessResponseURLs(ip net.IP, conf *config, cli *CLI) *runAccessResp
|
|
111
|
115
|
|
|
112
|
116
|
values.Set("server", ip.String())
|
|
113
|
117
|
values.Set("port", strconv.Itoa(int(conf.BindTo.port.Value(0))))
|
|
114
|
|
- values.Set("secret", conf.Secret.Base64())
|
|
115
|
118
|
|
|
116
|
119
|
if cli.Access.Hex {
|
|
117
|
|
- values.Set("secret", conf.Secret.EE())
|
|
|
120
|
+ values.Set("secret", conf.Secret.Hex())
|
|
|
121
|
+ } else {
|
|
|
122
|
+ values.Set("secret", conf.Secret.Base64())
|
|
118
|
123
|
}
|
|
119
|
124
|
|
|
120
|
125
|
urlQuery := values.Encode()
|