mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-12-07 18:30:25 +08:00
因WAF规则拦截而关闭连接时,不记录499
This commit is contained in:
57
internal/nodes/client_tls_conn.go
Normal file
57
internal/nodes/client_tls_conn.go
Normal file
@@ -0,0 +1,57 @@
|
||||
// Copyright 2021 Liuxiangchao iwind.liu@gmail.com. All rights reserved.
|
||||
|
||||
package nodes
|
||||
|
||||
import (
|
||||
"crypto/tls"
|
||||
"net"
|
||||
"time"
|
||||
)
|
||||
|
||||
type ClientTLSConn struct {
|
||||
rawConn *tls.Conn
|
||||
isClosed bool
|
||||
}
|
||||
|
||||
func NewClientTLSConn(conn *tls.Conn) net.Conn {
|
||||
return &ClientTLSConn{rawConn: conn}
|
||||
}
|
||||
|
||||
func (this *ClientTLSConn) Read(b []byte) (n int, err error) {
|
||||
n, err = this.rawConn.Read(b)
|
||||
return
|
||||
}
|
||||
|
||||
func (this *ClientTLSConn) Write(b []byte) (n int, err error) {
|
||||
n, err = this.rawConn.Write(b)
|
||||
return
|
||||
}
|
||||
|
||||
func (this *ClientTLSConn) Close() error {
|
||||
this.isClosed = true
|
||||
return this.rawConn.Close()
|
||||
}
|
||||
|
||||
func (this *ClientTLSConn) LocalAddr() net.Addr {
|
||||
return this.rawConn.LocalAddr()
|
||||
}
|
||||
|
||||
func (this *ClientTLSConn) RemoteAddr() net.Addr {
|
||||
return this.rawConn.RemoteAddr()
|
||||
}
|
||||
|
||||
func (this *ClientTLSConn) SetDeadline(t time.Time) error {
|
||||
return this.rawConn.SetDeadline(t)
|
||||
}
|
||||
|
||||
func (this *ClientTLSConn) SetReadDeadline(t time.Time) error {
|
||||
return this.rawConn.SetReadDeadline(t)
|
||||
}
|
||||
|
||||
func (this *ClientTLSConn) SetWriteDeadline(t time.Time) error {
|
||||
return this.rawConn.SetWriteDeadline(t)
|
||||
}
|
||||
|
||||
func (this *ClientTLSConn) IsClosed() bool {
|
||||
return this.isClosed
|
||||
}
|
||||
Reference in New Issue
Block a user