mirror of
https://github.com/ScuroNeko/mtg.git
synced 2026-08-31 15:04:03 +03:00
Add new secure-only mode
This commit is contained in:
@@ -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())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user