Add new secure-only mode

This commit is contained in:
9seconds
2018-09-24 18:04:00 +03:00
parent 3cf7f1396b
commit 7182c7bf65
3 changed files with 15 additions and 2 deletions
+5
View File
@@ -65,6 +65,11 @@ func (p *Proxy) accept(conn net.Conn) {
}
defer clientConn.(io.Closer).Close() // nolint: errcheck
if p.conf.SecureOnly && opts.ConnectionType != mtproto.ConnectionTypeSecure {
log.Errorw("Proxy supports only secure connections", "connection_type", opts.ConnectionType)
return
}
stats.ClientConnected(opts.ConnectionType, clientConn.RemoteAddr())
defer stats.ClientDisconnected(opts.ConnectionType, clientConn.RemoteAddr())