mirror of
https://github.com/v2fly/v2ray-core.git
synced 2026-01-01 06:55:25 -05:00
introduct Connection interface
This commit is contained in:
@@ -118,7 +118,7 @@ func (this *DokodemoDoor) ListenTCP(port v2net.Port) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (this *DokodemoDoor) HandleTCPConnection(conn *hub.TCPConn) {
|
||||
func (this *DokodemoDoor) HandleTCPConnection(conn hub.Connection) {
|
||||
defer conn.Close()
|
||||
|
||||
ray := this.packetDispatcher.DispatchToOutbound(v2net.TCPDestination(this.address, this.port))
|
||||
|
||||
@@ -95,7 +95,7 @@ func parseHost(rawHost string, defaultPort v2net.Port) (v2net.Destination, error
|
||||
return v2net.TCPDestination(v2net.DomainAddress(host), port), nil
|
||||
}
|
||||
|
||||
func (this *HttpProxyServer) handleConnection(conn *hub.TCPConn) {
|
||||
func (this *HttpProxyServer) handleConnection(conn hub.Connection) {
|
||||
defer conn.Close()
|
||||
reader := bufio.NewReader(conn)
|
||||
|
||||
|
||||
@@ -156,7 +156,7 @@ func (this *Shadowsocks) handlerUDPPayload(payload *alloc.Buffer, source v2net.D
|
||||
})
|
||||
}
|
||||
|
||||
func (this *Shadowsocks) handleConnection(conn *hub.TCPConn) {
|
||||
func (this *Shadowsocks) handleConnection(conn hub.Connection) {
|
||||
defer conn.Close()
|
||||
|
||||
buffer := alloc.NewSmallBuffer()
|
||||
|
||||
@@ -92,7 +92,7 @@ func (this *Server) Listen(port v2net.Port) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (this *Server) handleConnection(connection *hub.TCPConn) {
|
||||
func (this *Server) handleConnection(connection hub.Connection) {
|
||||
defer connection.Close()
|
||||
|
||||
timedReader := v2net.NewTimeOutReader(120, connection)
|
||||
|
||||
@@ -114,7 +114,7 @@ func (this *VMessInboundHandler) Listen(port v2net.Port) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (this *VMessInboundHandler) HandleConnection(connection *hub.TCPConn) {
|
||||
func (this *VMessInboundHandler) HandleConnection(connection hub.Connection) {
|
||||
defer connection.Close()
|
||||
|
||||
connReader := v2net.NewTimeOutReader(16, connection)
|
||||
|
||||
Reference in New Issue
Block a user