mirror of
				https://github.com/TeaOSLab/EdgeNode.git
				synced 2025-11-04 16:00:25 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			24 lines
		
	
	
		
			395 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			24 lines
		
	
	
		
			395 B
		
	
	
	
		
			Go
		
	
	
	
	
	
// Copyright 2021 Liuxiangchao iwind.liu@gmail.com. All rights reserved.
 | 
						|
 | 
						|
package waf
 | 
						|
 | 
						|
import (
 | 
						|
	"net/http"
 | 
						|
)
 | 
						|
 | 
						|
type BaseAction struct {
 | 
						|
}
 | 
						|
 | 
						|
// CloseConn 关闭连接
 | 
						|
func (this *BaseAction) CloseConn(writer http.ResponseWriter) error {
 | 
						|
	// 断开连接
 | 
						|
	hijack, ok := writer.(http.Hijacker)
 | 
						|
	if ok {
 | 
						|
		conn, _, err := hijack.Hijack()
 | 
						|
		if err == nil {
 | 
						|
			return conn.Close()
 | 
						|
		}
 | 
						|
	}
 | 
						|
	return nil
 | 
						|
}
 |