1
0

feat: 删除不需要文件夹

This commit is contained in:
TsMask
2023-10-10 10:56:44 +08:00
parent ce7c3cae68
commit d173205528
154 changed files with 32276 additions and 1 deletions

View File

@@ -0,0 +1,31 @@
package scan
import (
"net"
"strconv"
)
func ScanPort(port int) bool {
ln, err := net.Listen("tcp", ":"+strconv.Itoa(port))
if err != nil {
return true
}
defer ln.Close()
return false
}
func ScanUDPPort(port int) bool {
ln, err := net.ListenUDP("udp", &net.UDPAddr{IP: net.IPv4(127, 0, 0, 1), Port: port})
if err != nil {
return true
}
defer ln.Close()
return false
}
func ScanPortWithProto(port int, proto string) bool {
if proto == "udp" {
return ScanUDPPort(port)
}
return ScanPort(port)
}