Fix HTTP auth logging level & add option description to README

This commit is contained in:
Toby 2020-08-06 23:40:05 -07:00
parent 1301039807
commit 31e317d6ee
3 changed files with 13 additions and 2 deletions

View File

@ -90,6 +90,8 @@ The command line program supports loading configurations from both JSON files an
| Disable SOCKS5 UDP support | socks5_disable_udp | -socks5-disable-udp |
| HTTP listen address | http_addr | -http-addr |
| HTTP connection timeout in seconds | http_timeout | -http-timeout |
| HTTP basic auth username | http_user | -http-user |
| HTTP basic auth password | http_password | -http-password |
| Access control list | acl | -acl |
| Server address | server | -server |
| Authentication username | username | -username |
@ -162,3 +164,5 @@ By default, the program outputs DEBUG level, text format logs via stdout.
To change the logging level, set `LOGGING_LEVEL` environment variable, which supports `panic`, `fatal`, `error`, `warn`, `info`, ` debug`, `trace`
To print JSON instead, set `LOGGING_FORMATTER` to `json`
To change the logging timestamp format, set `LOGGING_TIMESTAMP_FORMAT`

View File

@ -88,6 +88,8 @@ Hysteria 是专门针对恶劣网络环境(常见于在中国访问海外服
| 禁用 SOCKS5 UDP 支持 | socks5_disable_udp | -socks5-disable-udp |
| HTTP 监听地址 | http_addr | -http-addr |
| HTTP 超时时间(秒) | http_timeout | -http-timeout |
| HTTP 验证用户名 | http_user | -http-user |
| HTTP 验证密码 | http_password | -http-password |
| ACL 规则文件 | acl | -acl |
| 服务端地址 | server | -server |
| 验证用户名 | username | -username |
@ -160,3 +162,5 @@ shady_hacker smokeweed420
如果需要修改日志级别可以使用 `LOGGING_LEVEL` 环境变量,支持 `panic`, `fatal`, `error`, `warn`, `info`, `debug`, `trace`
如果需要输出 JSON 可以把 `LOGGING_FORMATTER` 设置为 `json`
如果需要修改日志时间戳格式可以使用 `LOGGING_TIMESTAMP_FORMAT`

View File

@ -174,7 +174,10 @@ func proxyClient(args []string) {
}
decodeBytes, err := base64.StdEncoding.DecodeString(authStr[1])
if err != nil {
logrus.WithField("error", err).Fatal("Failed to decode base64 auth string")
logrus.WithFields(logrus.Fields{
"error": err,
"cred": authStr[1],
}).Debug("Failed to decode base64 auth string")
return req, resp
}
userAndPassword := strings.Split(string(decodeBytes), ":")