forked from backupsofdou4cc/MEOW
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathproxy_unix.go
More file actions
41 lines (35 loc) · 706 Bytes
/
proxy_unix.go
File metadata and controls
41 lines (35 loc) · 706 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// +build darwin freebsd linux netbsd openbsd
package main
import (
"os"
"net"
"syscall"
)
func isErrConnReset(err error) bool {
if ne, ok := err.(*net.OpError); ok {
if se, seok := ne.Err.(*os.SyscallError); seok {
return se.Err == syscall.ECONNRESET
}
}
return false
}
func isDNSError(err error) bool {
if _, ok := err.(*net.DNSError); ok {
return true
}
return false
}
func isErrOpWrite(err error) bool {
ne, ok := err.(*net.OpError)
if !ok {
return false
}
return ne.Op == "write"
}
func isErrOpRead(err error) bool {
ne, ok := err.(*net.OpError)
if !ok {
return false
}
return ne.Op == "read"
}